on 13-07-2012 05:06 PM
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?
on 13-07-2012 10:38 PM
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
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を一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870