Tinting Groups & Sprites?

6 replies [Last post]
coderebelbase's picture
coderebelbase
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 1 Feb 2010

Can you use :setFillColor on Groups and/or Sprites?

Replies

canupa.com's picture
canupa.com
User offline. Last seen 23 hours 57 min ago. Offline
Joined: 20 Jun 2011

tinting of sprites works!

-finefin

coderebelbase's picture
coderebelbase
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 1 Feb 2010

@canupa, nice how'd you do it? So far I'm only seeing errors.

canupa.com's picture
canupa.com
User offline. Last seen 23 hours 57 min ago. Offline
Joined: 20 Jun 2011

hm, don't know...
I'm using spriteGrabber and do this:

1
2
3
hero.object=heroSheet:grabSprite("hero", true ,{walk={1,4,500,0}})
hero.object:show(800,50,1.0,"c")
hero.object:setFillColor( 200, 0, 0 )

my hero is red.

-finefin

coderebelbase's picture
coderebelbase
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 1 Feb 2010

Sweet! I thought I tried this earlier, but it worked just now = )

1
2
3
4
5
local heroData = sprite.newSpriteSheetFromData( "hero.png", require("HeroData").getSpriteSheetData() )
local heroSet = sprite.newSpriteSet( data,1,4 )
sprite.add( heroSet,"hero",1,4,300,0 )
local hero = sprite.newSprite( heroSet )
hero:setFillColor( 200, 0, 0 )

Danny's picture
Danny
User offline. Last seen 1 hour 6 min ago. Offline
Staff
Joined: 17 Aug 2011

Yup the new image features (subscribers only via daily builds atm) are fantastic, they really help cut down on image duplication to vary colors :D

jeff472's picture
jeff472
User offline. Last seen 28 min 58 sec ago. Offline
Joined: 2 Dec 2011

If I use SetFillColor on a batch of sprites, and open the project as iPhone, then switch view to iPad, it crashes.
Without the setFillColor line, its OK.
Is setFillColor stable?

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.