DisplayBrushPart() with negative coordinates?
Posted: Sun Apr 14, 2024 12:19 pm
Hi all,
I want to scroll a picture under a fixed brush using DisplayBrushPart(). But I can't move it to the leftmost and top border of the picture as I had to use negative coordinates. Right now I am stucked in how to solve that problem, perhaps someone has an idea?
I want to scroll a picture under a fixed brush using DisplayBrushPart(). But I can't move it to the leftmost and top border of the picture as I had to use negative coordinates. Right now I am stucked in how to solve that problem, perhaps someone has an idea?
Code: Select all
Function _main()
Cls()
If IsKeyDown("left") Then part_x=part_x-1
If IsKeyDown("right") Then part_x = part_x+1
If IsKeyDown("up") Then part_y = part_y-1
If IsKeyDown("down") Then part_y=part_y+1
If part_x<-win_width/2 Then part_x = 0
If part_x>= maxwidth Then part_x=maxwidth
If part_y<0 Then part_y = 0
If part_y>maxheight Then part_y = maxheight
DisplayBrushPart(1,part_x,part_y,win_x,win_y,win_width,win_height)
DisplayBrush(2,cross_x,cross_y)
Flip()
EndFunction