Navigation

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

    setmode and sprite coordinates

    Help
    5
    11
    618
    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.
    • pianofire
      pianofire Fuze Team last edited by

      Sorry about this. A change was made in version 3 to bring things into line. If you want to use the old behaviour you have to put setcompatibility("2.15.0") at the top of your program. This was the way it worked when the videos were made.

      evilblade 1 Reply Last reply Reply Quote 0
      • evilblade
        evilblade @pianofire last edited by evilblade

        @pianofire well, yes, I know about setcompatibility, but is there maybe something to make this sprite-coordinates behave without reverting EVERYTHING to an older version?
        UPD: after careful reading of the help reguarding the setcompatibility function I come to a conclusion that it shoudn't affect anything but this spritecamera coordinates.. Im I right to assume that?..

        1 Reply Last reply Reply Quote 0
        • Z-Mann
          Z-Mann last edited by

          Can you show us your code? I think the order matters, you need to first set the resolution, then the sprite camera. A resolution change would keep the top left corner of the screen at the same sprite coordinages, I guess, leading to what you describe.

          evilblade 1 Reply Last reply Reply Quote 0
          • evilblade
            evilblade @Z-Mann last edited by evilblade

            @z-mann Sure


            the results of a code are on 2nd pic - with the setmode(1280,720) and on a 3rd - without it.
            As you can see - if I don't use the setmode - then the 1st sprite (0,0) is in the dead center of a screen, but if I do use it - then it's moved to the right and down...

            1 Reply Last reply Reply Quote 0
            • Martin
              Martin Fuze Team last edited by

              I admit that I've not had a lot of time to use Fuze lately, and when I have I've just used a setSpriteCamera command to put things back the way they used to be pre-patch, so I'm probably not the best person to comment but it looks to me like after setting the resolution to 720p, the sprite camera needs adjusting to take this into account. Whether that is an oversight on the part of Fuze or not I'm not sure because like I say, I've not had the time to really get my head round the new sprite coordinate system yet. I really should.

              evilblade 1 Reply Last reply Reply Quote 1
              • evilblade
                evilblade @Martin last edited by

                @martin OK, but wich is better - setcompatibility or just setspritecamera?
                Personally, I also like when (0,0) coordinates are in the top-left corner rather than at a center.. I wonder why you guys made it to be so in a 3.0.0 in a first place?..

                1 Reply Last reply Reply Quote 0
                • Willpowered
                  Willpowered Fuze Team last edited by

                  Ultimately this will come down to personal preference, but we determined that a camera with a centered origin makes more sense than a top-left origin for the following reasons:

                  • If you want the camera to follow an object, you can now set the camera's location to be the same as the object and it will be centered on the object, which many users would reasonably expect
                  • The center-origin camera rotates about its own location instead of (0, 0), which is more intuitive
                  • The center-origin camera zooms in/out about its own location instead of (0, 0), which is more intuitive

                  We'll take a look at the issue with the camera and setMode, it sounds like it should be working differently than it does. In the meantime, feel free to adjust the camera manually (recommended) or use setCompatibility("2.15.0") to use the old camera system for now. The old camera system, as with all compatibility mode functionality, may not be supported at some point in the future.

                  evilblade 1 Reply Last reply Reply Quote 0
                  • evilblade
                    evilblade @Willpowered last edited by

                    @willpowered Well.. thanks for the help, guys!
                    I've already added couple of lines of a code at the start that are looking at what is the current resolution and either call the setmode function or not and adjust the camera accordingly.

                    1 Reply Last reply Reply Quote 1
                    • Z-Mann
                      Z-Mann last edited by

                      @evilblade Do an additional update() right after setMode(). The bug simply seems to be that right after setMode, the sprite camera has not been updated to the proper screen resolution yet and picks the wrong screen centre. After the first update(), that is fixed.
                      Personally, I'd definitely go with the new way of setting the camera. And I'd set it up myself, not relying on any defaults, because while it is relatively clear how the camera centre and rotation should change on a setMode() (they should not change), the zoom level is less clear. Does it maintain the pixel zoom OR the general look on the screen? Both are equally right. (currently, the pixel zoom is maintainted, which is the third argument to setSpriteCamera, so that makes sense.)

                      evilblade 1 Reply Last reply Reply Quote 0
                      • evilblade
                        evilblade @Z-Mann last edited by

                        @z-mann said in setmode and sprite coordinates:

                        @evilblade Do an additional update() right after setMode().

                        Yup! That seams to do the trick. Thanks, man!

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