Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

setFillColor not acting after upgrade to latest version
Started by martin.kilkie Nov 17 2013 01:21 PM

3 replies to this topic

Best Answer nathanglass , 17 November 2013 - 01:25 PM

I'm having the same issues with setFillColor on newRect objects. I have not found a solution.

[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

martin.kilkie

[GLOBAL: userInfoPane.html]
martin.kilkie
  • Enthusiast

  • 75 posts
  • Corona SDK

Hi All,

 

I've just updated to latest version with graphics 2.0. Spent a merry hour or two redoing all coordinates.

Just found another issue.  (build 2076)

 

Altering colour of a object with object:setFillColor (r,g,B) doesn't work anymore, or rather it doesn't reliably change. The objects that don't change are newRect in most cases.

 

 



[TOPIC: post.html]
#2

nathanglass

[GLOBAL: userInfoPane.html]
nathanglass
  • Observer

  • 10 posts
  • Corona SDK

  Best Answer

I'm having the same issues with setFillColor on newRect objects. I have not found a solution.



[TOPIC: post.html]
#3

nathanglass

[GLOBAL: userInfoPane.html]
nathanglass
  • Observer

  • 10 posts
  • Corona SDK

See http://forums.coronalabs.com/topic/41376-colour-problem/?hl=setfillcolor

 

c6y says "Found out why. It's a new Graphics 2.0 feature:

 

'All RGBA color values have changed from 0:255 to 0:1. You can convert existing color values by dividing the old values by 255' "



[TOPIC: post.html]
#4

nathanglass

[GLOBAL: userInfoPane.html]
nathanglass
  • Observer

  • 10 posts
  • Corona SDK

See this link for more things that have changed with Graphics 2.0: http://www.coronalabs.com/blog/2013/10/16/wednesday-faqs-graphics-2-0/

 

 

 

3. What changes do I need to make to my code to run in the full Graphics 2.0 mode?

The following is a list of things you will need to change when you run your project in full Graphics 2.0 mode (when graphicsCompatibility is not included in your config.lua file).

  • Display Objects are created with X/Y (center) positioning instead of Top Left.
  • display.setReferencePoint has been removed. Use object.anchorX and object.anchorY instead.
  • display.newGradient has been deprecated. Use object.fill = table instead.
  • All RGBA color values have changed from 0:255 to 0:1. You can convert existing color values by dividing the old values by 255.
  • object:setTextColor has been deprecated. Use object:setFillColor or object.fill = value instead.
  • line:setColor has been deprecated. Use line:setStrokeColor instead.
  • line.width has been deprecated. Use line.strokeWidth instead.
  • xReferenceyReferencexOrigin and yOrigin have been removed. Use anchorX and anchorYinstead.
  • Groups don’t have anchor points enabled by default. You need to set “group.anchorChildren = true”to enable anchor points on the group.



[topic_controls]
[/topic_controls]