newbie questions

hello, Im new here.

new to corona and dusk engine.

I made a map using tiled map editor and load it using:

local dusk = require("Dusk.Dusk") local map = dusk.buildMap("tes.lua") 

I have some questions :

  1. my map succesfully loaded, but not fully displayed

    map size 64x64 using 16x16 tile

    can we display the full size of the map?

  1. can we use scrollview for the map?

thats all for now.

thanks :lol:

Hello and welcome to Corona and Dusk!

  1. You can try using Corona’s :scale function or setting the x/yScale directly:

    map:scale(0.5, 0.5) – Shrink the map by half map.updateView() – Update Dusk’s tile culling so the whole map shows

  2. You can definitely add the map to a scrollView, or you can write a touch listener for the map to move it like a scrollView. To add a map to a scrollView, just remember that the map is a display group. That means you’ll simply be using the scrollView’s insert function.

  • Caleb

thanks Caleb for quick reply

so it means that the map cant bigger than the screen? :frowning:

I must have misunderstood your question:

can we display the full size of the map?

I gave a solution displaying more of the map on the screen. If you’re looking to simply see the map as it moves, call map.updateView() each time the map moves and Dusk will draw and erase tiles as needed. You can definitely make a map bigger than the screen - my metroidvania’s opening hometown map is 128x64 tiles, and each tile is 64x64. That makes a 33 million-square-pixel map. That’s a good deal larger (understatement alert) than an iPad’s screen size.

  • Caleb

Im sorry. Maybe i should learn the basic first before bothering u caleb :slight_smile:
I dont even know how to move the map and where to put the code map.UpdateView(). I ll be back when I learned more bout corona, with better questions of course :slight_smile:

Many thanks

Hello and welcome to Corona and Dusk!

  1. You can try using Corona’s :scale function or setting the x/yScale directly:

    map:scale(0.5, 0.5) – Shrink the map by half map.updateView() – Update Dusk’s tile culling so the whole map shows

  2. You can definitely add the map to a scrollView, or you can write a touch listener for the map to move it like a scrollView. To add a map to a scrollView, just remember that the map is a display group. That means you’ll simply be using the scrollView’s insert function.

  • Caleb

thanks Caleb for quick reply

so it means that the map cant bigger than the screen? :frowning:

I must have misunderstood your question:

can we display the full size of the map?

I gave a solution displaying more of the map on the screen. If you’re looking to simply see the map as it moves, call map.updateView() each time the map moves and Dusk will draw and erase tiles as needed. You can definitely make a map bigger than the screen - my metroidvania’s opening hometown map is 128x64 tiles, and each tile is 64x64. That makes a 33 million-square-pixel map. That’s a good deal larger (understatement alert) than an iPad’s screen size.

  • Caleb

Im sorry. Maybe i should learn the basic first before bothering u caleb :slight_smile:
I dont even know how to move the map and where to put the code map.UpdateView(). I ll be back when I learned more bout corona, with better questions of course :slight_smile:

Many thanks