Hi, below is the beginning of my menu code for a simple game that I have almost finished. I'm a beginner and this is the first time that I've used types. The types seem to work as the code returns the values I'm after when using the types.
`Menu sytem
set window off
type menuType
title as string
width as integer
hight as integer
endtype
`menuType.title = words in menu
`menuType.width = text width
`menuType.hight = text hight
Dim menu(5) as menuType
`set out words used in the menu
menu(1).title = "1. Player 1 vs Player 2"
menu(2).title = "2. Player 1 vs Computer (easy)"
menu(3).title = "3. Player 1 vs Computer (medium)"
menu(4).title = "4. Player 1 vs Computer (hard)"
menu(5).title = "5. End Game"
`pre set starting posision for text to make it easyer to grab the image
xPre1 = 10
yPre1 = 10
`set the text charicturistics for each different wording
set text font "Arial"
set text size 12
print menu(x).title
print "press key"
wait key
cls
for xMen = 1 to 5
`set out the text on screen
text xPre1,yPre1, menu(x).title
`this gives values to width and hight of text taking account of charicturists already set
menu(xMen).width = text width(menu(xMen).title)
menu(xMen).hight = text height(menu(xMen).title)
`using the known pre set start pos and the text hight and width you can easily grab the correct immage
get image xMen,xPre1,yPre1,xPre1+menu(xMen).width,yPre1+menu(xMen).hight
print menu(xMen).width
print menu(xMen).hight
print "press key"
wait key
cls
next xMen
The problem. I have a string in the type I try top use the text and print commands to show the string on the screen and nothing happens?
I can't work out why, any pointers in the right direction would be much appreciated.
Jac
These are not the droids you are looking for.