Sven B:
That's strange.
In all your code that you post, it's actually a full tab that you are getting - that's 8 spaces per indent.
Don't know about anyone else, but after 3 indentations of your code, the line is 24 characters across the screen!
It must be your editor because I copied and pasted your code into my editor and immediately copied and pasted it back onto the forum and it doesn't have all the spaces in it.
What editor are you using?
sync on
`load sound
load sound "media/sounds/buttons/button.wav",1
do
`reset var
selected = 0
`clear screen
cls
`display buttons
if button(150,50,"button 1") > 0 then selected = 1
if button(150,100,"button 2") > 0 then selected = 2
if button(150,150,"button 3") > 0 then selected = 3
if button(150,200,"button 4") > 0 then selected = 4
if button(150,250,"button 5") > 0 then selected = 5
`display wich button has been clicked
ink rgb(255,255,255),0
center text 320,450,"selected: " + str$(selected)
sync
loop
`**********
`functions
`**********
function button(x,y,text$)
`reset pressed variable
pressed = 0
`get text width and height
tx = text width(text$)
ty = text height(text$)
`check for mouseclick over button
if mousex() < x + (tx/2) + 5 and mousex() > x - (tx/2) - 5
if mousey() < y + (ty/2) + 5 and mousey() > y - (ty/2) - 5
if mouseclick() = 1 then pressed = 1
endif
endif
`handle button
if pressed = 0
`if not pressed, make an outline border
ink rgb(255,255,255),0
box x - (tx/2) - 6, y - (ty/2) - 6, x + (tx/2) + 5, y + (ty/2) + 5
ink rgb(75,75,75),0
box x - (tx/2) - 5, y - (ty/2) - 5, x + (tx/2) + 6, y + (ty/2) + 6
else
`if pressed, make an inline border
ink rgb(75,75,75),0
box x - (tx/2) - 6, y - (ty/2) - 6, x + (tx/2) + 5, y + (ty/2) + 5
ink rgb(255,255,255),0
box x - (tx/2) - 5, y - (ty/2) - 5, x + (tx/2) + 6, y + (ty/2) + 6
endif
`make background of button
ink rgb(200,200,200),0
box x - (tx/2) - 5, y - (ty/2) - 5, x + (tx/2) + 5, y + (ty/2) + 5
`display text
ink 0,0
center text x,y - (ty/2) - 1,text$
`handle sound
if pressed = 1 and soundhold = 0
soundhold = 1
if sound exist(1) = 1
play sound 1
endif
endif
if mouseclick() = 0 then soundhold = 0
endfunction pressed
TDK_Man