Scrolling Game Development Kit Forum

SGDK Version 2 => Help, Errors, FAQ => Topic started by: v6v on 2012-11-22, 10:08:51 PM

Title: Source GraphicSheet for Framesets
Post by: v6v on 2012-11-22, 10:08:51 PM
Hey, I just had a monumentally brilliant idea,

Now I just need to know how possible this would be, but would it be possible to change the graphic sheet that a frameset was defined to use at Runtime?

The graphic sheets are the same size. I just need to change them at runtime.

I might have asked a similar question before.
Title: Re: Source GraphicSheet for Framesets
Post by: bluemonkmn on 2012-11-24, 09:59:44 AM
Each frame in a frameset can use a different graphic sheet, so you can't readily change it for the whole frameset in a single operation. However, if you can access all the frames, and you can access loaded instances of the GraphicSheet (TextureRef), you should be able to simply set the GraphicSheetTexture property of the frame to a new value.

A tileset, however, is always based on a single frameset. Would it by any chance make more sense to change the frameset on which a tileset is based? Tileset.cs is a generated class, and its members are private so in order to change its behavior, you would need to add a partial Tileset class and expose a means to change its internal m_strFrameset member (which is simply the frameset name). Not sure how well that'd work, but it's worth a try.

So you should be able to change the graphic sheet on which frames are based or the frameset on which tiles are based. And by "should" I mean that it looks possible, but I never really designed it to work that way, so there may be a catch.