Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Simple Screensaver

    Beginners
    2
    5
    280
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Linkokiri
      Linkokiri last edited by

      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

      1 Reply Last reply Reply Quote 6
      • Kat
        Kat Fuze Team last edited by

        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!

        1 Reply Last reply Reply Quote 7
        • Linkokiri
          Linkokiri last edited by

          Thx Kat! I'm going to test this and let you know if I have any difficulties ;)
          Glad to be in the FUZE community!

          1 Reply Last reply Reply Quote 5
          • Linkokiri
            Linkokiri last edited by

            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!

            1 Reply Last reply Reply Quote 3
            • Kat
              Kat Fuze Team last edited by

              Great! Glad I could help :)

              1 Reply Last reply Reply Quote 1
              • First post
                Last post