I am trying to draw two 10x10 chessboards.
i managed to draw the two boards perfectly, but it only works inside revolution. When i compile the program in windows xp, the boards are not drawn.
The program simply dont draw anything.
I want draw the chess board at anytime, and if there is any image created, delete ir and draw again the boards (may be with other colors, size, etc)
Here is my code, can you tell me what's worng please? thanks
Code: Select all
on mouseUp
# Si ya existe, borrar imagen aterior
if exists (image "board") then
delete image "board"
end if
# Definir los bordes de la imagen y definir nombre "board", luego crear imagen
set the rectangle of templateimage to 4, 4, 678, 342
set the name of the templateimage to "board"
create image "board"
# Dibujar los bordes de la imagen con el color de fondo blanco
choose the rectangle tool
set the pencolor to "black"
# color de fondo
set the brushcolor to "white"
drag from 4, 4 to 677, 341
# Dibujar cada uno de los cuadrados
# de los cuadros a partir del borde
repeat with x = 0 to 9
repeat with y = 0 to 9
# Determinar si debemos dibujar un cuadrado blanco o negro
if ((x + y) mod 2 = 0) then
set the brushcolor to "white"
else
set the brushcolor to "black"
end if
# Dibujar los cuadrados de la primera "board"
# el "+12" es debido a 4 pixels del inicio de la imagen en "4,4" + 8 de separacaion a partir del borde
drag from (x * 32) + 12, (y * 32) + 12 to ((x * 32) + 32 + 12) , ((y * 32) + 32 + 12)
# Dibujar los cuadrados de la segunda "board"
# el "+12" es debido a 4 pixels del inicio de la imagen en "4,4" + 8 de separacaion a partir del borde
# el "+336" es igual al tamaño * 10 celulas + 16 pixels de separacion entre las 2 boards
# 32 * 10 = 320 + 16 = 336
drag from (x * 32) + 12 + 336, (y * 32) + 12 to ((x * 32) + 32 + 12) + 336 , ((y * 32) + 32 + 12)
end repeat
end repeat
# Colocar el raton en modo normal
choose the browse tool
end mouseUp

