Simple Screensaver
-
Hey there,
I'm Linkokiri and I'd like to share with you my simple version of a screensaver!
Everyone can put his own Sprite and see it bouncing when reaching the screen borders ;)
I couldn't manage to let this work on Docked mode, even if I tried with
gwidth() and gheight() :/
Maybe you have suggestions!This is the hardcoded version for SwitchScreen [1280*720]
ID: SPWN3MNDX8 -
Hello! Welcome to FUZE Arena :) Nice program. A classic! And I love the sprite.
I think you may have discovered this now but I believe the problem you're having with docked mode is because sprites are a bit different in that they use the Sprite Camera. By default the Sprite Camera starts with 0, 0 as the centre of the screen. So in handheld the left side of the screen is now -640 but in docked it would be -960. One solution would be to offset the Sprite Camera by half of gWidth and gHeight so that the left hand of the screen is back to always being 0 as it would be in screen coordinates. You can do this by adding the line
setSpriteCamera( gWidth()/2, gHeight()/2 )
Inside of your main loop is best, so it will update if someone docks or undocks as the program is running. You would also need to change your setSpriteLocation line to set the sprite to just {x, y}. I hope that makes sense!
-
Thx Kat! I'm going to test this and let you know if I have any difficulties ;)
Glad to be in the FUZE community! -
Ok, I tested it and this is perfect ;) Thx a lot!
I'm going to read about setSpriteCamera (x, y) in detail in the Tutorial Section. Thx again! -
Great! Glad I could help :)