On Sun, Apr 8, 2012 at 6:05 PM, Pascal LE MERRER
<[email protected]>wrote:

> Hello
>
> I'm stuck with doing something I thought would be trivial.
> I want to draw a colored rectangle representing the life points of the
> player.
> I did not find how to do it with cocos2D.
> I did not find any way to draw a colored rectangle. Sprites require an
> image, which can't be cropped or resized along one dimension only (scale
> affects both height and width).
> I'm quite surprised. Did I miss anything ? What would be the best way to
> do this?
>
> Pascal
> --
>


Try with ColorLayer,
http://cocos2d.org/doc/api/cocos.layer.util_layers.ColorLayer-class.html.

An example call to obtain a 64 x 32 pure red rectangle

bar = cocos.layer.ColorLayer(255, 0, 0, 255, width=64, height=32)

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to