Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Stroke size?
Started by ok-sg Apr 23 2019 08:08 AM

10 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ok-sg

[GLOBAL: userInfoPane.html]
ok-sg
  • Observer

  • 9 posts
  • Corona SDK

Hello!

How can I increase size stroke of object like rectangle? Or how can you do strokeWidth?

 

For a long time there was no news about LevelDirector. Will there be a new version or something else?

 

 



[TOPIC: post.html]
#2

XeduR @Spyric

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

  • 838 posts
  • Corona SDK

Oh come on :D Just google it! Or http://letmegooglethat.com/?q=corona+sdk+stroke+width&l=1 :D

The very first result is https://docs.coronalabs.com/api/type/ShapeObject/stroke.html which contains several code samples, including:

local paint = { 1, 0, 0.5 }
local rect = display.newRect( 200, 300, 300, 300 )
rect.stroke = paint
rect.strokeWidth = 4

LevelDirector is old news, as far as I can tell/remember. The official scene management library these days is composer (https://docs.coronalabs.com/api/library/composer/index.html).
 



[TOPIC: post.html]
#3

ok-sg

[GLOBAL: userInfoPane.html]
ok-sg
  • Observer

  • 9 posts
  • Corona SDK

Thank you!

Maybe there is a way to define .strokeWidth in the LDX?



[TOPIC: post.html]
#4

XeduR @Spyric

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

  • 838 posts
  • Corona SDK

I have no idea as to what LDX is.



[TOPIC: post.html]
#5

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,913 posts
  • Enterprise

Pease don't confuse the old Director Class which was a Lua based scene manager and Level Director X which is a third-party layout tool from Retrofit Productions.

 

Rob



[TOPIC: post.html]
#6

retrofitProductions

[GLOBAL: userInfoPane.html]
retrofitProductions
  • Contributor

  • 321 posts
  • Corona SDK

Unfortunately, there is not an option to specify the strokewidth, it was never requested, but I'll certainly consider adding it.

 

 

You can always reference the object in code and then set a strokewidth.



[TOPIC: post.html]
#7

ok-sg

[GLOBAL: userInfoPane.html]
ok-sg
  • Observer

  • 9 posts
  • Corona SDK

Can i categorize objects with "Class" in object properties and set them global .strokeWidth? How can i implement that?



[TOPIC: post.html]
#8

XeduR @Spyric

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

  • 838 posts
  • Corona SDK

Ah, seems like I got the two mixed :D Thanks for the heads up!

I tried learning about what the actual Level Director is, but I can't actually connect to the website. I'm met with:

Access has been blocked.

Your IP [173.254.28.39] has been identified as spam

Protected by: AVH First Defense Against Spam

-

 

You've got some issues going on with your site. That IP isn't mine and it isn't even from my country. I also tried with a proxy and another device as well, but I'm met with the same message. It could be that your site has cached this error message and it is delivering it to all visitors. In any case, I thought to let you know as you are potentially losing business because of it.



[TOPIC: post.html]
#9

retrofitProductions

[GLOBAL: userInfoPane.html]
retrofitProductions
  • Contributor

  • 321 posts
  • Corona SDK

@Xedur, thanks for letting me know about this, one of the plugins I use went rogue and seems to be blocking everyone, so I have now disabled it, you should be able to access it now.



[TOPIC: post.html]
#10

retrofitProductions

[GLOBAL: userInfoPane.html]
retrofitProductions
  • Contributor

  • 321 posts
  • Corona SDK

@ok-sg - with regards to setting a class, if you want to set them to the same strokewidth, or use different class names for different stroke widths then this would be possible.

You can't set them globally, but you can find the objects with a class name, and then iterate through the objects like below (untested)

local objects = myLevel:objectsWithClass("stroke2")
for k, v in pairs (objects) do
   v.view.strokeWidth=2
end


[TOPIC: post.html]
#11

ok-sg

[GLOBAL: userInfoPane.html]
ok-sg
  • Observer

  • 9 posts
  • Corona SDK

Thank you! 

 

Looking forward to new LDX updates!




[topic_controls]
[/topic_controls]