On 31 January 2010 07:00, James Paige <[email protected]> wrote:
> On Sat, Jan 30, 2010 at 11:09:13PM +1300, Ralph Versteegen wrote:
>> On 30 January 2010 13:28,  <[email protected]> wrote:
>> > james
>> > 2010-01-29 16:28:10 -0800 (Fri, 29 Jan 2010)
>> > 182
>> > All slices now support a .Clip property that causes children to be clipped.
>> > GridSlice cells support clipping too.
>> > TMC, thanks for allmodex's setclip() which made this easy to do! :)
>> > ---
>> > U   wip/sliceedit.bas
>> > U   wip/slices.bas
>> > U   wip/slices.bi
>>
>> Actually Simon wrote that, so I thought that it was always part of
>> allmodex? Maybe not.
>
> Oh? I had thought it was a new addition.
>
>> Are you planning to expose that to scripting with a command to make
>> any slice clip its children? This is simpler than a separate
>> ClippingSlice, but I'm not sure whether it makes sense to allow any
>> slice to clip, especially sprites. What is the size and position of a
>> sprite? Remember: it will depend on the current frame, and on its
>> animation state.
>
> I do plan on exposing this to scripting, but not until I have them
> better tested, and I am confident that I am doing them in a sane way.
>
> Last night before bed I realized that slices are only clipping inside
> their first clipping parent, and overflowing any outer clipping
> grandparents. (but I have an idea for fixing that)
>
> All slices have to be clipping aware to make clipping work, so I think
> it is best to allow all slice types to clip. That is to say, I can't see
> any advantage to add a secial case to forbid sprites from clipping.
>
> I don't see variable sprite size causing a problem. That just means the
> spriteslice size will change when the animation frame changes, and that
> is no problem.

Well, I already notice a problem: clipping right now is based on a
slice's screen coordinates, which for an animating sprite are not the
same as the position at which it's drawn. Recall the idea that sprite
animations could include frame offsets, which do NOT affect the
'logical' (slice) position.

> ---
> James

OK, I just had a look at this clipping code. Eeek! setclip was not
intended for this kind of over-use.
If you try to attach a RectSlice with a border or a MapSlice to a
clipping parent, you should find that clipping simply fails since
these call setclip themselves when drawing - they are not primitives.
Also, the first thing drawn might also call setclip (from within
allmodex) if it changes wrkpage.
Using frame_new_view would be simpler, safe, and more elegant than
this setclip hackery (this is actually basically what it was intended
for) EXCEPT that it changes the origin of the screen. Hmmm. I guess
we'll just have to switch to views and add an extra offset to slice
position when drawing to undo the double translation.
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to