Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

lines are not displayed in some devices in Corona Simulator
Started by Sheldonopolis Sep 12 2019 12:52 AM

2 replies to this topic
corona simulator display display.newline

Best Answer XeduR @Spyric , 12 September 2019 - 01:32 AM

That has to do with Corona's dynamic scaling most likely.

 

In your config.lua, what width and height have you defined? Most likely what is happening is that you've defined a larger content area, which then leads to downscaling the content for smaller devices. Since you have not given the lines a width, i.e. it defaults to 1px, then downscaling from 1px to less than 0.5px probably results in the lines not showing at all.

 

i.e. give your lines a larger width and/or look at your content area settings.

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Sheldonopolis

[GLOBAL: userInfoPane.html]
Sheldonopolis
  • Observer

  • 6 posts
  • Corona SDK

Hi,
In my project, I create several circles and draw lines between them (with display.newLine), but when I simulates the project in Corona Simulator, the lines are not visible in some devices, Can anyone please help?
 
The minimum code to reproduce the problem is like:

local radius = 20
local circles = {}
for i = 1, 5 do
  circles[i] = {}
  for j = 1, 8 do
    circles[i][j] = display.newCircle(100 * j + (j - 0.5) * 2 * radius, 100 * i + (i - 0.5) * 2 * radius, radius)
  end
end
for i = 1, 5 do
  for j = 1, 7 do
    display.newLine(circles[i][j].x, circles[i][j].y, circles[i][j + 1].x, circles[i][j + 1].y)
  end
end

The screenshots are attached.

iphone6:

Attached File  iphone6.png   33.8KB   0 downloads,

Samsung galaxy s5:

Attached File  samsung galaxy s5.png   106.36KB   0 downloads,

nokia lumia 920:

Attached File  lumia920.png   90.59KB   0 downloads



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 989 posts
  • Corona SDK

  Best Answer

That has to do with Corona's dynamic scaling most likely.

 

In your config.lua, what width and height have you defined? Most likely what is happening is that you've defined a larger content area, which then leads to downscaling the content for smaller devices. Since you have not given the lines a width, i.e. it defaults to 1px, then downscaling from 1px to less than 0.5px probably results in the lines not showing at all.

 

i.e. give your lines a larger width and/or look at your content area settings.



[TOPIC: post.html]
#3

Sheldonopolis

[GLOBAL: userInfoPane.html]
Sheldonopolis
  • Observer

  • 6 posts
  • Corona SDK

That has to do with Corona's dynamic scaling most likely.
 
In your config.lua, what width and height have you defined? Most likely what is happening is that you've defined a larger content area, which then leads to downscaling the content for smaller devices. Since you have not given the lines a width, i.e. it defaults to 1px, then downscaling from 1px to less than 0.5px probably results in the lines not showing at all.
 
i.e. give your lines a larger width and/or look at your content area settings.

 
It is exactly like what you said. The lines are displaying correctly with a larger stroke width.

Thank you so much. :D




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: corona simulator, display, display.newline