View Full Version : Grid - Chess Board Question.
Centauri Soldier
08-13-2009, 12:25 AM
I have successfully made a chessboard with dynamic colors and alternating squares out of the grid object but now I'm thinking that I'd like to use pictures instead. Is there any way to use the Grid object for this or do I need to find another method?
Teqskater
08-13-2009, 09:39 AM
I would go for image objects. One image for the chessboard and then images for the chesspieces. And then you could make tables with each field position and piece positions like so
Field = {}
--[[
Index Explanation:
1 = Field A1
2 = Field A2
....
]]--
Field[1] = {}
Field[1].X = 500 -- Estimated
Field[1].Y = 10 -- Estimated
Field[2] = {}
Field[2].X = 450 -- Estimated
Field[2].Y = 10 -- Estimated
--[[
Index Explanation:
1 = 1stPawn
9 = Knight
]]--
WhitePieces = {}
WhitePieces[1] = {}
WhitePieces[1].X = Field[2].X
WhitePieces[1].X = Field[2].Y
I hope you get my idea and make it better. ;)
Centauri Soldier
08-13-2009, 01:15 PM
I would go for image objects. One image for the chessboard and then images for the chesspieces. And then you could make tables with each field position and piece positions like so
Field = {}
--[[
Index Explanation:
1 = Field A1
2 = Field A2
....
]]--
Field[1] = {}
Field[1].X = 500 -- Estimated
Field[1].Y = 10 -- Estimated
Field[2] = {}
Field[2].X = 450 -- Estimated
Field[2].Y = 10 -- Estimated
--[[
Index Explanation:
1 = 1stPawn
9 = Knight
]]--
WhitePieces = {}
WhitePieces[1] = {}
WhitePieces[1].X = Field[2].X
WhitePieces[1].X = Field[2].Y
I hope you get my idea and make it better. ;)
Thanks for your suggestion, Teqskater. I was just trying to avoid using this method. This was the only alternative that I could think of too. I would rather do it with Grid Object which is why I'm posting now. I'm not looking for methods on how to make the chess board (because I have a thousand ideas myself) but rather methods specifically for doing this with the Grid Object. Does anyone have any work-around code for the grid lying around that would allow me to use images in the cells?
Dermot
08-13-2009, 02:43 PM
The grid object does not support images. You will have to use a different method. If you want to use images, then really the only option is to use the image object.
Centauri Soldier
08-13-2009, 02:45 PM
The grid object does not support images. You will have to use a different method. If you want to use images, then really the only option is to use the image object.
I was afraid there was going to be an answer like that...oh well. I will make due. Thanks guys.
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.