Corona SDK setFillColor does not stain when mixing colors

I am just a new user of Corona SDK and Im following some exercises of the book. I tried to create a rectangle and color it, but if I put setFillColor (255,0,0) or put 255 in green or blue, it will work. The problem is that when I try to mix colors like setFillColor (100,129,93), it just draws a white rectangle.

This is my main.lua:

rect_upperBackground = display.newRect(150, 150, 100, 50)
rect_upperBackground:setFillColor(49, 49, 49)
+4
source share
2 answers

According to the documentation , setFillColorcolor is required in the range [0, 1], not [0, 255]. So for example, you can try this instead.

rect_upperBackground:setFillColor(100 / 255, 129 / 255, 93 / 255)
rect_upperBackground:setFillColor(0.4, 0.2, 0.5)
+9
source

object: setFillColor() 0-255, SDK 0-1, . ( 0-1 - , 0-255, .)

, , .., , .

: setReferencePoint(), . object.anchorX object.anchorY( - , , , ).

, - , , : http://www.develephant.net/3-things-you-need-to-know-about-corona-sdk-graphics-2-0/

2013.2076 Corona SDK.

+3

All Articles