Dubbsta
Active member
- Joined
- Jul 13, 2017
- Messages
- 208
ive done this a hundred times now and cant see whats wrong...can someone spot it?
i get no reaction
forgot how to put the better codebox
i get no reaction
forgot how to put the better codebox
Code:
Class Icon
Field iconimg:Image[16]
Field y:Int[16]
Field x:Int[16]
Method New()
For Local i:Int = 0 Until iconimg.Length
iconimg[i] = LoadImage("gfx/pieces/icons200/icon" + String(i) +".png",
1,Image.MidHandle)
x[i] = CENTERX
y[i] = CENTERY + i * 250
End
End
Method draw:Void()
'SetAlpha fade
For Local i:int = 0 Until iconimg.Length
DrawImage(iconimg[i],x[i],y[i] ,0)
DrawText(y[i],100, 300 +i *30)
End
DrawText(MouseX() ,300, 300 )
DrawText( MouseY(),300, 330 )
End
End
Class IconSelectScrn
Field icon:Icon
Field scrntitle:Image
Field next_btn:Button
Field nextscrn:Int
Method New()
icon = New Icon()
scrntitle = LoadImage("selecticon.png",1,Image.MidHandle)
next_btn = New Button("gfx/menu/buttons/next_btn.png",
DeviceWidth() - 180,DeviceHeight() - 180,3)
End
Method pressed:Void()
If next_btn.coll(next_btn)
next_btn.frame = 1
nextscrn = 1
Else
next_btn.frame = 0
nextscrn = 0
End
End
Method selected:Bool()
For Local i:Int = 0 Until icon.iconimg.Length
If MouseX() < icon.x[i] - icon.iconimg[i].Width() * .5 Or
MouseX() > icon.x[i] + icon.iconimg[i].Width() * .5 Return False
If MouseY() < icon.y[i] - icon.iconimg[i].Height() * .5 Or
MouseY() > icon.y[i] + icon.iconimg[i].Height() * .5 Return False
End
Return True
End
Method scroll:Void()
For Local i:Int = 0 Until icon.iconimg.Length()
icon.y[i] -= 5
If icon.y[i] <= 350
icon.y[i] = icon.y[i] +
icon.iconimg.Length() * 250
End
End
selected()
End
Last edited by a moderator: