Is it possible to set UI button's image with spritesheet?

As question asked,
I try to sent ui button with spritesheet. But it doesn’t work.
[lua] local sheet = sprite.newSpriteSheet(“buttonSheet.png”,100,100);
local spriteSet = sprite.newSpriteSet(sheet, 1, 10);
local spriteBtn = {};
for i=1, spriteNum do
spriteBtn[i] = sprite.newSprite(spriteSet);
spriteBtn[i].currentFrame = i;
end

local button = {};
for i=1, 10 do
button[i] = ui.newButton{
defaultSrc = spriteBtn[i],…[/lua]

I want to packed texture to reduce file size…
If the ui button can use with spritesheet, it will be wonderful. Is it possible? [import]uid: 65906 topic_id: 17984 reply_id: 317984[/import]

No, this isn’t possible.

You could make your own button using a spritesheet that looked like a normal ui button if you wished, however.

Peach :slight_smile: [import]uid: 52491 topic_id: 17984 reply_id: 68698[/import]

I see, thanks peach! [import]uid: 65906 topic_id: 17984 reply_id: 68700[/import]

Actually, that depends on the ui.lua

Take a look at that one…

http://developer.anscamobile.com/code/enhanced-ui-library-uilua
[import]uid: 10478 topic_id: 17984 reply_id: 68701[/import]

Hey PixelEnvision,

I hadn’t previously seen this - it’s awesome you put it together :slight_smile: Will have to check it out properly later.

SleepySheepy, I guess perhaps with the help of PixelEnvision’s code this is possible! Awesome!

Peach :slight_smile: [import]uid: 52491 topic_id: 17984 reply_id: 68714[/import]

Thanks, it works fine [import]uid: 65906 topic_id: 17984 reply_id: 69392[/import]