Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Best (Fastest) Method To Darken Full Screen Background?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 15th Dec 2017 21:35
Hi,

Trying to get the HTML5 to run just a little better.

On all screens except title screen I was clearing the screen with black color
and drawing the full screen background with an alpha transparency of "64" to darken the background.
(the above is fine on Android but very expensive on HTML5)

Is there a better and faster method to darken the full screen backgrounds?
Let me know, thanks!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 15th Dec 2017 21:48
Maybe render the screen to an image
1. RenderToImage()
2. Delete all the sprites
3. Make the rendered to image a sprite
4. fade the rendered to sprite
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 15th Dec 2017 21:51 Edited at: 15th Dec 2017 21:54
EDIT [first comment deleted by me]

Never mind my previous comment, because I had a brain fart about the 'Full Screen' part of your post.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 15th Dec 2017 22:07
Yes, "RenderToImage()" is what I need!
Thank you!
JeZxLee
16BitSoft
Video Game Design Studio
http://www.16BitSoft.com
Open-Source AppGameKit Project!
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 16th Dec 2017 16:58
Or, have a full screen (black) sprite at depth 50 say, with all background sprites at a greater depth.
All foreground sprites lower depth than 50.

Then simply alter the transparency of the big sprite.
You could have that sprite disabled until you need the fade to avoid unnecessary transparency work.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 16th Dec 2017 21:55
As nz0 says - I've used that. Start with a tiny 16px by 16px sprite and stretch (without antialiasing) and fade it up.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2024-04-25 14:28:58
Your offset time is: 2024-04-25 14:28:58