Author Topic: Source GraphicSheet for Framesets  (Read 4551 times)

v6v

  • Clever
  • Fanatic
  • ***
  • Posts: 500
  • Has renamed his project to Galaxy!
    • View Profile
    • My Developer Page!
    • Email
Source GraphicSheet for Framesets
« 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.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Source GraphicSheet for Framesets
« Reply #1 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.