Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

newbie questions
Started by yen001688 May 21 2016 08:05 PM

4 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

yen001688

[GLOBAL: userInfoPane.html]
yen001688
  • Observer

  • 10 posts
  • Corona SDK

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?
 
2. can we use scrollview for the map?
 
thats all for now.
thanks :lol:

 



[TOPIC: post.html]
#2

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

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



[TOPIC: post.html]
#3

yen001688

[GLOBAL: userInfoPane.html]
yen001688
  • Observer

  • 10 posts
  • Corona SDK

thanks Caleb for quick reply

 

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



[TOPIC: post.html]
#4

Caleb P

[GLOBAL: userInfoPane.html]
Caleb P
  • Corona Geek

  • 1,424 posts
  • Corona SDK

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



[TOPIC: post.html]
#5

yen001688

[GLOBAL: userInfoPane.html]
yen001688
  • Observer

  • 10 posts
  • Corona SDK

Im sorry. Maybe i should learn the basic first before bothering u caleb :)
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 :)

Many thanks


[topic_controls]
[/topic_controls]