Wäre lieb wenn ihr mir sagen könntet, wieso hier der Point Befehl nicht funktioniert (Fehler = Outside the drawing area)
Code: Alles auswählen
InitSprite()
InitMouse()
InitKeyboard()
ExamineDesktops()
OpenScreen(DesktopWidth(0),DesktopHeight(0),DesktopDepth(0),"Niklas Upmann",#PB_Screen_SmartSynchronization,DesktopFrequency(0))
Global mx,my,ScrollX,ScrollY
UsePNGImageDecoder()
Structure Karte
typ.s
besetzt.b
EndStructure
Global Dim Karte.Karte(900,900)
Procedure Load_Map_Tiles()
tsprite = LoadSprite(#PB_Any,"terrain.png")
DisplaySprite(tsprite,0,0)
StartDrawing(ScreenOutput())
width = SpriteWidth(tsprite)
height = SpriteHeight(tsprite)
If width > 800 Or height > 800
End
EndIf
For x = 0 To width
For y = 0 To height
Karte(x,y)
farbe = Point(x,y)
If Green(farbe) = 94 And Red(farbe) = 0 And Blue(farbe) = 0
Karte(x,y)\typ = "1"
ElseIf Green(farbe) = 0 And Red(farbe) = 0 And Blue(farbe) = 197
Karte(x,y)\typ = "0"
EndIf
Next
Next
StopDrawing()
EndProcedure
Load_Map_Tiles()
Repeat
ExamineMouse()
ExamineKeyboard()
mx = MouseX()
my = MouseY()
ClearScreen($000000)
StartDrawing(ScreenOutput())
For x = 0 To 50
For y = 0 To 50
If Karte(x,y)\typ = "1"
Box(x*20,y*20,20,20,RGB(0,233,0))
ElseIf Karte(x,y)\typ = "0"
Box(x*20,y*20,20,20,RGB(0,0,233))
EndIf
Next
Next
StopDrawing()
FlipBuffers()
Until KeyboardReleased(1)
End
NathanielBlack