Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

[Solved] setFillColor not working in Build 2013.2xxx
Started by moflaherty Nov 27 2013 12:41 PM

1 reply 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

moflaherty

[GLOBAL: userInfoPane.html]
moflaherty
  • Observer

  • 9 posts
  • Corona SDK

Hello everyone,

 

Today I updated to the latest daily build, 2013.2091. When I loaded my project, all of the objects using display.newRect were completely white.

 

I recreated the issue by dumping this into a main.lua:

local displayBug = display.newRect(0,0, display.contentWidth / 2, display.contentHeight / 2)
displayBug:setFillColor(120,120,120) -- Still white after this line
displayBug.x = display.contentWidth / 2
displayBug.y = display.contentHeight / 2

Did setFillColor become deprecated in the new version or is this a bug?

 

Any help is appreciated! Thanks!

 

EDIT: To anyone else having the same problem, it looks like they've switched from 0-255 RGB to 0.0-1.0 numbers. Sorry, I missed this in the migration guide.

 

http://docs.coronalabs.com/guide/graphics/migration_g20.html#TOC



[TOPIC: post.html]
#2

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

  Best Answer

displayBug:setFillColor(120/255,120/255,120/255)

 

See http://forums.coronalabs.com/topic/40216-why-change-the-color-parameter-values/




[topic_controls]
[/topic_controls]