I come across a few problems with SetScissor().
The first problem looks like a bug or some error in re-setting the SetScissor bound.
Refer to the above picture: I set the scissor about 10 pixels margin on the white rectangle box.
As I move the box, the scissor should follow. But when the box X is less than 0, it seems that the scissor is altered its location. That is weird
My code is here
The other issue is not a bug.
I run in html5 target, and I feel that the scissor is a bit late to update its location.
As I move the box, the scissor is left a bit behind.
The first problem looks like a bug or some error in re-setting the SetScissor bound.
Refer to the above picture: I set the scissor about 10 pixels margin on the white rectangle box.
As I move the box, the scissor should follow. But when the box X is less than 0, it seems that the scissor is altered its location. That is weird
My code is here
Code:
Import mojo2
Function Main();New MyApp;End
Class MyApp Extends App
Field x,y,width=100,height=100
Field margin=10
Field c:Canvas
Method OnCreate()
c=New Canvas()
End
Method OnUpdate()
x=MouseX()
y=MouseY()
End
Method OnRender()
c.Clear 0,0,255
c.SetColor(1,1,1)
c.DrawRect(x-width/2,y-height/2,width,height)
c.SetScissor(x-width/2-margin,y-height/2-margin,width+margin*2,height+margin*2)
c.Flush()
End
End
The other issue is not a bug.
I run in html5 target, and I feel that the scissor is a bit late to update its location.
As I move the box, the scissor is left a bit behind.