Navigation

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

    Screen coordinates

    Help
    8
    13
    583
    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.
    • emptytheory
      emptytheory F last edited by

      The tutorial on the screen says that the x- and y-axes begin at 0. But in order to color the pixel at the top left with plot() the coordinates need to be (1, 1). And, of course, if the rows of pixels went from 0 to 720, and the columns from 0 to 1280, then there would be 721 rows and 1281 columns, making the total number of pixels 2001 more than the tutorial says. Is there some reason for counting from row and column 0 if these are off-screen?

      1 Reply Last reply Reply Quote 0
      • Discostew
        Discostew F last edited by

        Technically speaking, 720p means 720 lines. With base 0, those lines are designated 0 to 719, just as columns are from 0 to 1279.

        N 1 Reply Last reply Reply Quote 1
        • N
          Nisse5 F @Discostew last edited by

          @Discostew But the point is that the coordinate system is 1-based, not 0-based as the documentation says.

          In docked mode (1080p)

          plot(200, 1080, white)
          

          will result in a visible dot at the bottom of the screen. If it would have been a 0-based coordinate system, that dot wouldn't show up.

          1 Reply Last reply Reply Quote 0
          • Discostew
            Discostew F last edited by

            Hmm, just checked, it does range from 1-1080 (docked) on the y axis, and 1-1920 on the x. Yet on the HELP page for plot(), it randomizes the x/y destination based on the screen dimensions, but random() ranges from 0 to one less than the inputted value. Guess we can ask if this is a bug, but in the meantime, if you use 0-based plotting, you can always just add 1 to the overall X/Y coordinates.

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

              Really...?! - you have got to be kidding! this should be 0 to 1919 etc. We will have to fix that.

              pianofire Discostew Myddrak 3 Replies Last reply Reply Quote 0
              • pianofire
                pianofire Fuze Team @Jonboy last edited by

                @Jonboy Yes I have noticed that this morning

                1 Reply Last reply Reply Quote 0
                • Discostew
                  Discostew F @Jonboy last edited by

                  @Jonboy Hehe, it should be an easy fix, yeah?

                  1 Reply Last reply Reply Quote 0
                  • Myddrak
                    Myddrak @Jonboy last edited by

                    @Jonboy said in Screen coordinates:

                    Really...?! - you have got to be kidding! this should be 0 to 1919 etc. We will have to fix that.

                    but then you'll either need to change gheight/gwidth to return the 0 based value, or we'll need to start subtracting 1 from it?

                    N 1 Reply Last reply Reply Quote 0
                    • N
                      Nisse5 F @Myddrak last edited by

                      @Myddrak gheight/gwidth are dimensions, not coordinates.

                      Myddrak 1 Reply Last reply Reply Quote 0
                      • Myddrak
                        Myddrak @Nisse5 last edited by

                        @Nisse5
                        yeah, but

                        for x=1 to gwidth()
                        

                        vs

                        for x=0 to gwidth()-1
                        

                        just sayin
                        :pensive:

                        1 Reply Last reply Reply Quote 0
                        • M
                          MikeDX last edited by MikeDX

                          If I were drawing to the screen, I would start at 0 and finish at gwidth(), since that would be 0 to gwidth()-1

                          for a = 0 to gwidth() loop
                          print(a)
                          repeat
                          

                          would output (sort of)

                          0
                          1
                          2
                          ....
                          1918
                          1919
                          
                          1 Reply Last reply Reply Quote 1
                          • Myddrak
                            Myddrak last edited by

                            sorry, my mistake, I missed where for loops don't include the boundary... all good :)

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

                              @Myddrak said in Screen coordinates:

                              sorry, my mistake, I missed where for loops don't include the boundary... all good :)

                              To be fair, I’d say it is a little on the quirky side but just one of those things. As long as you know, it’s easy enough to live with.

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