Is it possible to move a layer which was drawn on a brush, i.e.
Code: Select all
SelectBrush(1)
Circle(10,10,10,{name="myCircle"})
EndSelect
Something like:
Code: Select all
SetLayerStyle("myCircle",{x=30,y=40})
Thanks, Tom
Code: Select all
SelectBrush(1)
Circle(10,10,10,{name="myCircle"})
EndSelect
Code: Select all
SetLayerStyle("myCircle",{x=30,y=40})
Not really, because the layer still exists and is not freed. You can access it with GetAttribute() and also SetLayerStyle() does not cause an error on that layer. Unfortunately, it also has no effect to use SetLayerStyle().By using SelectBrush(), your circle becomes part of the brush (not a separate layer).
That doest not work in my case, because I want to have a "whole" in a layer, which shows the layer behinde. The only way to do that, which i can see, is, to draw the circle on a brush and then to select the brush's alpha channel. Unfortunately, then, you cannot move the circle anymore.So if you want it to treat it as a separate layer, then you can draw it over the brush, but do not make it part of the brush. In other words, don't use SelectBrush() when you draw your circle.
No, Paul is rightNot really, because the layer still exists and is not freed. You can access it with GetAttribute() and also SetLayerStyle() does not cause an error on that layer. Unfortunately, it also has no effect to use SetLayerStyle().
Code: Select all
EnableLayers
CreateBrush(1, 320, 256)
SelectBrush(1)
Box(0, 0, 320, 256, #RED, {Name = "bla"})
EndSelect
DebugPrint(GetAttribute(#DISPLAY, 0, #ATTRLAYERS))
WaitLeftMouse
End
Yes, it is inconsistent, read the doc on SelectBGPic() which elaborates extensively on this topicMore over, by using SelectBGPic(), the circle also does not become part of the BGPic, so this behaviour seems to be somehow inconsistent.
You can force a layer refresh by using the "ID" tag of SetLayerStyle(), i.e.That doest not work in my case, because I want to have a "whole" in a layer, which shows the layer behinde. The only way to do that, which i can see, is, to draw the circle on a brush and then to select the brush's alpha channel. Unfortunately, then, you cannot move the circle anymore.
The final (not very nice) solution is then, to make the brush double as hight and double as wide as the screen resolution and then to move the entire brush (inclusively the circle). This isn't too fast on high resolution screens![]()
Code: Select all
DisplayBrush(1, 0, 0)
.... modify brush here...
SetLayerStyle(1, {ID = 1}) ; update brush layer
TrueNo, Paul is rightWhenever SelectBrush() is active, no layers are added. You might not get an error message, but the layer is definitely not added. You will always be drawing directly to the brush. Just try:
This will print 0.Code: Select all
EnableLayers CreateBrush(1, 320, 256) SelectBrush(1) Box(0, 0, 320, 256, #RED, {Name = "bla"}) EndSelect DebugPrint(GetAttribute(#DISPLAY, 0, #ATTRLAYERS)) WaitLeftMouse End
Maybe this is faster? Hm. Have to test this. For now, i move the whole brush with double size of the display, which works ok, but is much slower than moving just a circleYou can force a layer refresh by using the "ID" tag of SetLayerStyle(), i.e.
Code: Select all
DisplayBrush(1, 0, 0) .... modify brush here... SetLayerStyle(1, {ID = 1}) ; update brush layer
Of course that doesn't help me to solve the problemMaybe this is faster? Hm. Have to test this. For now, i move the whole brush with double size of the display, which works ok, but is much slower than moving just a circle
I just wanted to create a AVI which shows what I'm currently doing. Unfortunately, it's pretty slow to create a 800x600 presentation -- even on a Peg2 and writing to RAM:After some mouse interactions, it then even crashed before the video was done
. Too bad
![]()
Hmm, couldn't reproduce this either. I guess it only happens with a certain layer setup or something, so I'd need a small example that demonstrates the crash.Oh, another Bug report:
The transition effect: #WATER2 causes on AOS4 always a system freeze!
To get rid of the crashes (see post about stack problems before), i decided to change the implemention in the way you suggested it here. No, i always update the brush by redrawing the part which have changed instead of moving the whole brush.You can force a layer refresh by using the "ID" tag of SetLayerStyle(), i.e.
Code: Select all
DisplayBrush(1, 0, 0) .... modify brush here... SetLayerStyle(1, {ID = 1}) ; update brush layer