Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Subframe's not considered in Settexture  (Read 3900 times)

0 Members and 1 Guest are viewing this topic.

raychaser

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 16
    • View Profile
Subframe's not considered in Settexture
« on: October 21, 2007, 08:28:51 PM »

I'm having a problem whereby only the base frame shows up when I use a sprite as a texture using SetTexture. Is this a bug? It would be great to have control of subframes as well as the main frames to do complex dynamic sprite scripting and animation.

Also it seems that only the transparency of the root frame is considered.

My setup: I've got a base frame with a skin texture and then a couple of effect subframes on top. I then use settexture to assign this sprite to a material.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: Subframe's not considered in Settexture
« Reply #1 on: October 22, 2007, 08:47:52 PM »

No, it's not a bug, it's intentional. Only simple sprites can be used for animated textures, no subframes.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

raychaser

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 16
    • View Profile
Re: Subframe's not considered in Settexture
« Reply #2 on: October 23, 2007, 12:40:15 AM »

feature request?

It would be amazing to be able to have a layered-up sprite that we could control things like facial features using subframe sprites. For example I could have the eyeballs as one sprite and write a little script to have them shift around and look at things. Eyebrows and mouth could be a different subframe and we could easily build an entire expression engine to do cartoony animation like grim fandango.

The goal:
actor.setExpression("Happy");
actor.setEyes("shifty");

Oh well, for now I suppose I can do it by rendering each eye position for each expression into a separate image and then switching back and forth. That's a lot of images though so I think the sprite would be rather large.

Can anyone think of another way to do this? Has anyone tried this before?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: Subframe's not considered in Settexture
« Reply #3 on: October 23, 2007, 08:32:14 PM »

It's not that simple, unfortunately. It would require either multi texturing, which might not be available on some video cards (depending on how many subframes you'd use), or pre-composing the final texture in memory, and that would be slow... Not to mention the texture needs to be rectangular, but combined subframes don't.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.154 seconds with 25 queries.