Navigation

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

    Moving Maps

    Coding
    8
    17
    1114
    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.
    • Retrocade_media
      Retrocade_media F last edited by

      Hi, I'm messing with Tilemaps for the first time, and I have a question.
      Without using the spritecamera, is there any way to Scale and Move the tilemap?

      Spacemario 1 Reply Last reply Reply Quote 0
      • Spacemario
        Spacemario F @Retrocade_media last edited by

        @Retrocade_media I'm using the sprite camera in my game-- I just update its X/Y coordinates as the player moves, but it could just as easily be moved independently. Is there a reason that won't work for you? Just trying to grasp the problem better.

        Retrocade_media 1 Reply Last reply Reply Quote 0
        • Retrocade_media
          Retrocade_media F @Spacemario last edited by

          @Spacemario Because the way my border is set up and how all the sprites spawn

          Spacemario 1 Reply Last reply Reply Quote 0
          • Spacemario
            Spacemario F @Retrocade_media last edited by

            @Retrocade_media Oh, gotcha'... you have game-specific requirements! I guess one of the Fuze team members can chime in if there's another way :)

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

              So I figured out that when you do drawmaplayer you can scale and move it then and there via a vector or a float. Is there a drawmapcollision function or something like that? Cause collision doesn't scale with the map for some reason

              Willpowered vinicity 2 Replies Last reply Reply Quote 0
              • pianofire
                pianofire Fuze Team last edited by

                OK so it looks like there are some undocumented overloads. I assume that you have found on of those. Can you show me the code please and I will investigate? I wasn't even aware of these myself so it is possible that they are unsupported.

                Retrocade_media 1 Reply Last reply Reply Quote 1
                • Retrocade_media
                  Retrocade_media F @pianofire last edited by

                  @pianofire you can see what all this supports by doing drawmaplayer(gibberish)
                  1579986534947641666035.jpg

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

                    Thanks I'll get back to you

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

                      @Retrocade_media said in Moving Maps:

                      Cause collision doesn't scale with the map for some reason

                      I can understand the confusion, but the collision functions don't know where you've drawn the map. Map collision and map drawing are two entirely separate processes that have no relation to each other. The sprite camera is intended to be used in most cases to zoom in/out and follow the player around the map. The collision should always line up and be consistent if you use it.

                      drawMapLayer on the other hand is intended for more specialized effects, such as parallax background, minimap drawing, or whatever else you can think of! If you use this, you'll have to make sure your gameplay is still taking place in "map space." For example, if you have a collision box at (100, 100) it will not move no matter where your map is drawn. It's always going to be at (100, 100) and will always be the same size for collision purposes.

                      OK so it looks like there are some undocumented overloads. I assume that you have found on of those. Can you show me the code please and I will investigate? I wasn't even aware of these myself so it is possible that they are unsupported.

                      Sprite and map functions that take positions, scales, and colors as parameters typically have overloaded definitions that instead support vectors in the place of those float values.

                      Retrocade_media 1 Reply Last reply Reply Quote 5
                      • Retrocade_media
                        Retrocade_media F @Willpowered last edited by

                        @Willpowered That is really good information, thank you! This should be added to the hints and tips forum

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

                          To be fair, it should be in the help. And now we know, it can go in the help ;)

                          1 Reply Last reply Reply Quote 2
                          • vinicity
                            vinicity F @Retrocade_media last edited by

                            @Retrocade_media said in Moving Maps:

                            So I figured out that when you do drawmaplayer you can scale and move it then and there via a vector or a float. Is there a drawmapcollision function or something like that? Cause collision doesn't scale with the map for some reason

                            Just a quick question:

                            Are these overloads safe to use? They won’t get deprecated in a newer release? Are they even being added to the Help page, perhaps?

                            pianofire 1 Reply Last reply Reply Quote 1
                            • pianofire
                              pianofire Fuze Team @vinicity last edited by

                              @vinicity said in Moving Maps:

                              drawmaplayer

                              This is from the latest (not released yet) help file:

                              drawMapLayer( layer )
                              
                              drawMapLayer( layer, x, y )
                              
                              drawMapLayer( layer, x, y, rotation, scale )
                              
                              drawMapLayer( layer, location )
                              
                              drawMapLayer( layer, location, rotation, scale )
                              
                              drawMapLayer( layer, location, rotation, scale, tint )
                              
                              1 Reply Last reply Reply Quote 1
                              • vinicity
                                vinicity F last edited by vinicity

                                Thanks!

                                Does the scale take a vector as well, or is it always a float (proportional scaling)?

                                pianofire 1 Reply Last reply Reply Quote 2
                                • pianofire
                                  pianofire Fuze Team @vinicity last edited by

                                  @vinicity It only says float:

                                  {code:layer} Integer - Index number of the map layer to draw (zero is the first)

                                  {code:x} Float - Horizontal screen position of the layer origin point

                                  {code:y} Float - Vertical screen position of the layer origin point

                                  {code:rotation} Float - Rotation applied to the map layer in degrees or radians

                                  {code:scale} Float - Scale factor applied to the map layer

                                  {code:location} Vector - Screen location vector in 2 dimensions { x, y }

                                  {code:tint} Vector - Colour applied to the map layer in RGBA format { red, green, blue, alpha }, or colour n

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

                                    I think we'll need examples for all of these because at the moment I believe drawLayer(x,y) respects spritecamera and I wouldn't know what the others do!

                                    1 Reply Last reply Reply Quote 1
                                    • spikey
                                      spikey F last edited by

                                      The way to get my collision map working undocked and docked and making use of 1920x1080 on TV was by applying setMode(1920,1080). In my past projects, this decreased the performance when undocked, so I did not use setMode() but scaled the coordinates. And for my current project the performance does not seem to be an issue. But is there another way to achieve this? I mean @Willpowered already answered this clearly, just want to make sure, I understand the application of the info.

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