Graphics

Reply

How do I update a RawSpriteTileList so that it scrolls? I have included what I have tried.

I accentidently posted this in General but I think it is better suited here. Moderator, if you wish, please delete my post in General.

 

So I am creating a RawSpriteTileList like this:

 

RawSpriteTileList rstl = new RawSpriteTileList(new TextureInfo(new Texture2D("/Application/woodland.png", false), new Vector2i(16, 16)));
			
int tileSize = 32;
			
for( int i=0; i < 30; i++) {
	for( int y = 0; y < 17; y++ ) {
		RawSpriteTile rst = new RawSpriteTile(new TRS(new Bounds2(new Vector2(i * tileSize, y * tileSize), new Vector2((i*tileSize) + 32, (y*tileSize) + 32))), new Vector2i(0, 15), false, false);
		rstl.Sprites.Add(rst);
	}
}

 

How does one go about scrolling this. In my game loop I was attempting to do something like this:

for( int i=0; i < rstl.Sprites.Count; i++) 
{ rstl.Sprites[i].Quad.T.X += 1; }

 But that isn't compiling. This is really basic as I am just trying to figure it out. Any help would be appreciated. 

 

Thanks,

Mike

Please use plain text.

Re: How do I update a RawSpriteTileList so that it scrolls? I have included what I have tried.

Hi:

 

Why it's not compiling post the error please =).

 

Cheers,

Please use plain text.

Re: How do I update a RawSpriteTileList so that it scrolls? I have included what I have tried.

So the error that I am getting when trying to compile this is: 

 

Error CS1612: Cannot modify the return value of 'System.Collections.Generic.List<Sce.PlayStation.HighLevel.GameEngine2D.RawSpriteTile>.this[int]' because it is not a variable (CS1612) 

 

I have tried it other way to where it would compile however the tiles never moved and the X value didn't appear to change. 

 

If anyone has any suguestions to offer I would appreciate it. 

 

Mike

Please use plain text.

Level 3

Level 3
Mojotron
Posts: 83
Registered: ‎07-06-2012
Message 4 of 4 (96 Views)

Re: How do I update a RawSpriteTileList so that it scrolls? I have included what I have tried.

When you got it to compile, they didn't appear to move because you didn't re-add the tiles afterwards.  You need to clear before you re-add, or else you'll get a smearing effect I believe (and the list will just keep growing).

Please use plain text.
This widget could not be displayed.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。






Recent News