on 27-12-2011 09:48 PM
I'm trying to use the SampleSprite example as a base to implement rendering from a spritesheet. From what I've gathered so far, it's using the VertexBuffer to define the rectangle of the sprite. Although I haven't solved it yet, does anyone have a basic solution for this problem yet?
If I figure it out, I'll try to post my solution.
Thanks!
Solved! Go to Solution.
28-12-2011 04:07 PM - edited 28-12-2011 04:08 PM
Update: Well, I was able to get something to work using the SampleSprite example. However, once I clean up the code a little I'll post the solution. To give you a quick hint of how I solved it, the VertexBuffer was the key into solving the problem. I had to modify the SetTexture method in the example to be able to calculate the UV coordinates for the spritesheet.
The simple solution takes into account a fixed width/height dimensions for each frame. I also added properties to keep track of the number of frames by breaking up the spritesheet into rows and columns. Knowing the width/height and how many rows and columns, I'm able to define a rectangle that will map exactly to the frame I want to render.
I'll post the code and example screenshots once I clean up the code. Stay tuned.
29-12-2011 12:51 AM - edited 29-12-2011 12:52 AM
i had modifed the image sample to display textures from a list. Basically all that I need to implement is the Image.Cropped method to select individual segments of a sprite sheet to add to the list.
http://i1176.photobucket.com/albums/x326/rogerdodg
on 29-12-2011 01:45 AM
Interesting! I was also looking at the Image Crop example shortly after I implemented my solution. I would love to see how you did it. Thanks for sharing! ![]()
on 29-12-2011 03:06 AM
on 29-12-2011 03:16 AM
Cool! I'll take a look at this in a few. Yeah, I was also thinking of trying to create a blank Texture or canvas and create a render method to fill the current frame from the texture data from each sprite. I'm still trying to get familiar with the Texture2D class.
Thanks for posting your solution and keep up the great work!
on 29-12-2011 04:12 AM
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