Image overlays in Turing
Author |
Message |
Luganchan
|
Posted: Thu Jan 09, 2014 1:14 pm Post subject: Image overlays in Turing |
|
|
What is it you are trying to achieve?
I'm trying to layer one image onto another in Turing.
What is the problem you are having?
I don't know how to have a background image and another image moving overtop, without erasing the background
Long version
My idea here was to make a cave explorer game in Turing in a similar style to caves in Pokemon (prior to gen 4) Where you only have a limited sight of your surroundings. I need to have a black overlay to move around with my character and block out some vision, but i have no idea how to do this without erasing the background. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Raknarg
|
Posted: Thu Jan 09, 2014 1:28 pm Post subject: RE:Image overlays in Turing |
|
|
Consider this:
All you do is redraw the background every frame (so once per loop). |
|
|
|
|
|
evildaddy911
|
Posted: Thu Jan 09, 2014 3:50 pm Post subject: RE:Image overlays in Turing |
|
|
take a look at Pic.Draw, specifically the last parameter, mode:int |
|
|
|
|
|
Raknarg
|
Posted: Thu Jan 09, 2014 4:01 pm Post subject: RE:Image overlays in Turing |
|
|
Hold on, allow me to reword your question, OP. Are you asking how to make it so you can only see a circle cut out of the background, and the rest shrouded in black? As if you have a lantern shining from the character that only goes so far? |
|
|
|
|
|
Dreadnought
|
Posted: Thu Jan 09, 2014 9:12 pm Post subject: Re: Image overlays in Turing |
|
|
I agree with Raknarg, it sounds like what you want is to put an image (black screen with a circle cut out) overtop of your game. (I guess you would call this a mask) instead of drawing your game over a background.
evildaddy911 is right, you can use the mode parameter of Pic.Draw to make a colour (white by default) transparent when you draw a picture. This would allow you to make a mask and just draw it on top of everything with the correct mode.
There is an even easier way of doing this. So easy in fact I feel like it's almost cheating, so I'll just tell you to look in the View module. |
|
|
|
|
|
evildaddy911
|
Posted: Thu Jan 09, 2014 9:55 pm Post subject: RE:Image overlays in Turing |
|
|
wow.. i guess you learn something new every day eh? |
|
|
|
|
|
Luganchan
|
Posted: Fri Jan 10, 2014 12:14 pm Post subject: Re: RE:Image overlays in Turing |
|
|
Raknarg @ Thu Jan 09, 2014 4:01 pm wrote: Hold on, allow me to reword your question, OP. Are you asking how to make it so you can only see a circle cut out of the background, and the rest shrouded in black? As if you have a lantern shining from the character that only goes so far?
Exactly that, im trying to apply a mask, but if i redraw the background every frame, it gets very flickery if it refreshes every frame with lareg images, i'll try the Pic.Draw parameter, and report what happens, you guys are a savior for a procrastinating gr.11 student. |
|
|
|
|
|
Insectoid
|
Posted: Fri Jan 10, 2014 12:40 pm Post subject: RE:Image overlays in Turing |
|
|
Quote: it gets very flickery if it refreshes every frame
This is actually really easy to fix. You'll find a solution in the FAQ sticky in Turing Help. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Luganchan
|
Posted: Fri Jan 10, 2014 12:46 pm Post subject: RE:Image overlays in Turing |
|
|
I am currently using the View.Update, and View.Set, the animation of the backgroud is smooth, but my actual character now has very delayed movements, and bugs with the background more than ever, i'm sure that i can solve the collision issue, but the movements have become very static and move a few extra pixels after i set go of the command keys. |
|
|
|
|
|
Insectoid
|
Posted: Fri Jan 10, 2014 1:22 pm Post subject: RE:Image overlays in Turing |
|
|
Well then, your View.Update is probably in the wrong spot, or your animation is poorly structured. |
|
|
|
|
|
|
|