Drawing surface [SOLVED]

Started by Dualnames, Thu 26/08/2010 06:30:39

Previous topic - Next topic

Dualnames

So below lies a code that I'm using to draw raindrops.
It randomly draws a rain amount on two places I want (d, and d2) and on 10 loops it restores the surface creating the effect I want. Now I also want the shame effect on the player (d3) and it works nicely, but I can't see the sprites unless the character is transparent. Apparently cause surfaces are drawn on the background. So question is how do I do this?

EDIT: Thanks a lot, solved. :D

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Gilbert

I having read the codes, but if you want the d3 part to be in front of the player, maybe you can draw them on another DynamicSprite instead of the background?

Maybe you can also use FollowCharacter() to let the engine automatically align the sprite with the character.

Khris

Yes, drawing the d3 part on a non-clickable GUI should work.

GarageGothic

1) Create a dummy character, make player character invisible.
In rep_exec_always
2) Update dummy chars coordinates to be identical to player's in rep-exec 
2) Create DynamicSprite based on (invisible) player character's current Graphic, resized according to player.Scaling.
3) Draw rain on background, in case particles are in front of player sprite, draw to dummy DynamicSprite.
4) Once drawing done, Release DynamicSprite. Set dummy character's ViewFrame to use DynamicSprite as its Graphic.

In case of multiple characters, a GUI for the whole screen would make more sense. This version of the effect does support alpha channels/transparency of raindrops/characters, though (create DynamicSprite without preserving alpha channel, draw raindrops overlaying player both on background and player, copy the alpha channel of the original player sprite to the dummy DynamicSprite).

SMF spam blocked by CleanTalk