letters for tiles(like scrabble)

I was curious what I should do if I want to make tiles for a board game. With the letters a-z… Is it best to just make each tile as an individual gfx assest… So that I would have 26 images of the tile… with a different letter on it. Or is it possible to just use one blank tile, and create the text on it with code?

If the latter is the better solution. How would I go about programming it? I was unsure how to “attach” the letter to the tile. [import]uid: 28912 topic_id: 13005 reply_id: 313005[/import]

Well 26 small images isn’t bad. You can also use a sprite sheet which is the most efficient with regards to memory.

But you can also do a single graphic and add text to it.

[lua]local function getTile(letter)
local letterGroup = display.newGroup()
local thisTileBG = display.newImageRect(“tile.png”, 64, 64);
letterGroup:insert(thisTileBG)
local thisLetter = display.newText(letter, 0, 0, “Helvetica-Bold”, 60);
letterGroup:insert(thisLetter)
return letterGroup
end

localGroup = display.newGroup()
local background = display.newImageRect(“background.png”, 480, 320);
localGroup:insert(background)

letters = {‘A’,‘B’,‘C’,‘D’,…, ‘Z’}
tiles = {}
for i=1, 26 do
tiles[i] = getTile(letters[i]
localGroup:insert(tiles[i])
tiles[i].x = i*32
tiles[i].y = 200
end[/lua]
[import]uid: 19626 topic_id: 13005 reply_id: 47743[/import]

ok, thats cool. So each letter is just a little group with the tile image and text. Thanks for advice [import]uid: 28912 topic_id: 13005 reply_id: 47746[/import]

Yeah, groups are cool because you can create one, add text or graphics, and then just manipulate that group as a whole instead of worrying about all the separate pieces.

Jay [import]uid: 9440 topic_id: 13005 reply_id: 47763[/import]

Yeah, groups are cool because you can create one, add text or graphics, and then just manipulate that group as a whole instead of worrying about all the separate pieces.

Jay [import]uid: 9440 topic_id: 13005 reply_id: 47765[/import]