Graphics

Reply

Member

Member
mfcas
Posts: 1
Registered: ‎19-04-2012
Message 1 of 2 (127 Views)

SpriteList and TextureInfo issue

I have 3 types of sprites in my project:

 

- 48x48 tiles

- 100x100 tiles

- loose sprites with various sizes

 

I want to put them all in a one big texture so all the sprites can get batched nicely, the problem is that since SpriteList needs a TextureInfo and not the Texture2D it seems to me that I can't set up the texture tiling (because it's set per TextureInfo).

 

There is no problem at all if I would use SpriteUV for all the sprites, but is there any way to get the SpriteList to work with two TextureInfos using the same Texture2D ?

 

If not, would I be better off with one SpriteList  with:

-1 TextureInfo and lots of SpriteUVs

 

than:

-2 SpriteLists with 2 different TextureInfos using the same Texture2D and SpriteTiles + SpriteUVs?

 

 

 

 

Please use plain text.

Re: SpriteList and TextureInfo issue

Hi Mfcas

 

You are correct in that a SpriteList requires a TextureInfo object, however in the constructor for the TextureInfo, you will need to pass in your Texture2D object. Also in the constructor for the TextureInfo, you will need to specify the number of tiles that you would like your Sprite Sheet / Tile Map divided up into.

 

TextureInfo info = new TextureInfo(new Texture2D("/Application/sprites.png", false), new Vector2i(5,5));
SpriteList list = new SpriteList(info);

 From here, you can then create some SpriteTile objects, selecting the TileIndex2D/1D and add these to your SpriteList. 

 

If you have any questions, please feel free to ask.

 

James

PlayStation®Mobile Dev Team
Please use plain text.
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を一度ログアウトし、再度ログインしてください。