Drawing an entity on top of other graphics
Displaying 1-8 of 8 total.
1
Gleznov
|
How do I determine layers in respect to entities vs. images?
Case in point:
I load my image box.
I spawn my entity (an arrow where z0 = pure transparent image, z1 = the arrow, I use z0 to turn it off, z1 to turn it on)
I set entitymove(cursor,'z1'); to make it visible
I alter entity.x and entity.y for it to set where it goes
When the menu is opened, it draws the image box, then printstring's the options.
At this point I want my arrow in front of the first option, but it doesn't render, and I know that it's covered up by the image box. I want the entity on TOP of the image box, but as far as I know, once an active VC file spawns an entity, you can't unspawn it, so I can't spawn it every time I draw that box, or else moving through the menus will generate like 50 cursors... I think... I dunno, can I tell an entity to be on a certain layer and other stuff to be on a different layer, then render the layers in that order? How do I go about fixing this?
Glez
Posted on 2005-10-21 10:14:21
|
RageCage
|
You have to put the R before the E in the renderstring and use hookretrace to put your image on the screen. This does however cause you to not be able to put anything on top of that... and for this reason I uploaded a nifty file called DualRetrace.vh to www.actionsketch.com/junk/DualRetrace.vh
Posted on 2005-10-21 10:25:32 (last edited on 2005-10-21 10:26:49)
|
RageCage
|
It sounds like you're entity is your mouse cursor? If this is so... you do not want this. You want to have a image and just tblit it onto the screen.
Posted on 2005-10-21 10:28:45
|
Gleznov
|
@RageCage:
I'm looking at the curmap.rstring stuff in the doc and looking at your code, but I'm confused - could you give me a quick rundown of how this works?
Glez
Posted on 2005-10-21 10:30:45
|
Gleznov
|
Sorry, let me be a little more specific:
How do I specify which layer I'm drawing the image to, to be sure I'm drawing it underneath the entity layer?
Glez
Posted on 2005-10-21 10:33:32
|
Gleznov
|
Yeah you're right, TBlit might be better... For some reason I determined that in battle, it was easier for me to use an entity for my cursor (for both indicating which party member's turn it was, as well as selecting an enemy to attack);
In this case, TBlit is obviously superior. I bow to your wisdom ;P
Glez
Posted on 2005-10-21 10:34:57
|
RageCage
|
the code works like this, you have a rstring like 12RE34 and then the DualRetrace adds a R to the end so you have 12RE34R which will call the retraced function twice per cycle. The dualretrace keeps track of which retrace it's on and calls the different retrace functions acordingly. hookretrace1 would be the first retrace in the cycle, aka the retrace under the entity.
Posted on 2005-10-21 11:57:38
|
mcgrue
|
The sully code actually has this too. Check out the Labs for an example.
Posted on 2005-10-21 14:25:03
|