Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to paint a rectangle with gradient — Gideros Forum

How to paint a rectangle with gradient

psdiaspsdias Member
edited December 2012 in General questions
Hi !
(Sorry for my bad English).

There is a simple way for me to paint a rectangular region with a gradient (not a solid color) ?

Note: I am new in GIDEROS development.

Thank you very much !
Paulo

Comments

  • hnimhnim Member
    edited December 2012
    hi, you can use mesh api:
    example
    local mesh = Mesh.new() 
    mesh:setVertices(1, 0, 0, 2, 300, 0, 3, 300, 300, 4, 0, 300) 
    mesh:setIndexArray(1, 2, 3, 1, 3, 4) 
    mesh:setColorArray(0xff0000, 1.0, 0xff0000, 1.0, 0xffff00, 0.5, 0xffff00, 0.5) 
    stage:addChild(mesh)
    gradient.png
    296 x 300 - 2K

    Likes: thanhquan1512

    +1 -1 (+1 / -0 )Share on Facebook
  • Thank you very much !
    Paulo

    Dislikes: totebo

    +1 -1 (+0 / -1 )Share on Facebook
Sign In or Register to comment.