[HC] Image Panning / Animation
(Msg 1 of 15)
DTS <daretospam@[redacted].com>
Thursday, 20-Sep-2012 21:54 GMT
I am thinking about how to use larger images (1-bit) within the default
card size (512x384). One method is to have an image that sort of pans
around either automatically or with click and drag. What would be the best
way of doing this?
Another item I would like to try to animate in HyperCard is a converted
animated gif. Would page flipping be fast enough? Or some kind of
animated sprite routine, like changing icons? I don't think HyperCard can
change icons simultaneously since the animation is larger than 32x32.
Thanks,
Tom
[Non-text portions of this message have been removed]
[HC] Image Panning / Animation
(Msg 2 of 15)
Rebecca Bettencourt <beckiergb@[redacted].com>
Thursday, 20-Sep-2012 22:02 GMT
Here's a trick that can be used to do either: set the name of the button to
the name of a PICT resource, and set its icon to -1 (yes, negative one).
Now you have a button that displays the PICT. Then you can change its name
dynamically to do the animation, or add some mouse handlers to do
click-and-drag (I believe there are some Readymade Buttons that will do
that).
On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
> **
>
>
> I am thinking about how to use larger images (1-bit) within the default
> card size (512x384). One method is to have an image that sort of pans
> around either automatically or with click and drag. What would be the best
> way of doing this?
>
> Another item I would like to try to animate in HyperCard is a converted
> animated gif. Would page flipping be fast enough? Or some kind of
> animated sprite routine, like changing icons? I don't think HyperCard can
> change icons simultaneously since the animation is larger than 32x32.
>
> Thanks,
> Tom
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]
[HC] Image Panning / Animation
(Msg 3 of 15)
Catherine Kunicki <marsvi0let@[redacted].com>
Thursday, 20-Sep-2012 22:09 GMT
Wow. This is the kind of question I used to answer with great authority. I can't even remember, honesty, now. I do know you'll need to use a pict to display - as I recall, gifs didn't work. You could use certain jpgs which were saved in Quicktime for display in Addcolor and there was the "picture XCMD" for BW or color picts, too. But gifs won't work at all, and you really don't want to try the other methods.
Rebecca's suggestion for the -1 thing with picts is the best choice.
Catherine
On Sep 20, 2012, at 5:54 PM, DTS <daretospam@[redacted].com wrote:
> I am thinking about how to use larger images (1-bit) within the default
> card size (512x384). One method is to have an image that sort of pans
> around either automatically or with click and drag. What would be the best
> way of doing this?
>
> Another item I would like to try to animate in HyperCard is a converted
> animated gif. Would page flipping be fast enough? Or some kind of
> animated sprite routine, like changing icons? I don't think HyperCard can
> change icons simultaneously since the animation is larger than 32x32.
>
> Thanks,
> Tom
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
[HC] Image Panning / Animation
(Msg 4 of 15)
DTS <daretospam@[redacted].com>
Thursday, 20-Sep-2012 22:39 GMT
Sounds exactly like what I need! How do I change the icon ID to -1? I
tried picking an icon and then selecting edit to change the ID number but I
got an error. I imported a PICT resource using resedit and gave it a name
(the PICT was converted from gif in Photoshop).
Thanks,
Tom
On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <beckiergb@[redacted].comwrote:
> Here's a trick that can be used to do either: set the name of the button to
> the name of a PICT resource, and set its icon to -1 (yes, negative one).
> Now you have a button that displays the PICT. Then you can change its name
> dynamically to do the animation, or add some mouse handlers to do
> click-and-drag (I believe there are some Readymade Buttons that will do
> that).
> On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
>
> > **
> >
> >
> > I am thinking about how to use larger images (1-bit) within the default
> > card size (512x384). One method is to have an image that sort of pans
> > around either automatically or with click and drag. What would be the
> best
> > way of doing this?
> >
> > Another item I would like to try to animate in HyperCard is a converted
> > animated gif. Would page flipping be fast enough? Or some kind of
> > animated sprite routine, like changing icons? I don't think HyperCard can
> > change icons simultaneously since the animation is larger than 32x32.
> >
> > Thanks,
> > Tom
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
[HC] Image Panning / Animation
(Msg 5 of 15)
Rebecca Bettencourt <beckiergb@[redacted].com>
Thursday, 20-Sep-2012 23:02 GMT
You can't give it an icon of -1 from the GUI. You have to do it from
HyperTalk. Bring up the message box and enter: set the icon of card button
"foo" to -1
On Sep 20, 2012 3:39 PM, "DTS" <daretospam@[redacted].com wrote:
> **
>
>
> Sounds exactly like what I need! How do I change the icon ID to -1? I
> tried picking an icon and then selecting edit to change the ID number but I
> got an error. I imported a PICT resource using resedit and gave it a name
> (the PICT was converted from gif in Photoshop).
>
> Thanks,
> Tom
>
> On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <beckiergb@[redacted].com> >wrote:
>
> > Here's a trick that can be used to do either: set the name of the button
> to
> > the name of a PICT resource, and set its icon to -1 (yes, negative one).
> > Now you have a button that displays the PICT. Then you can change its
> name
> > dynamically to do the animation, or add some mouse handlers to do
> > click-and-drag (I believe there are some Readymade Buttons that will do
> > that).
> > On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
> >
> > > **
> > >
> > >
> > > I am thinking about how to use larger images (1-bit) within the default
> > > card size (512x384). One method is to have an image that sort of pans
> > > around either automatically or with click and drag. What would be the
> > best
> > > way of doing this?
> > >
> > > Another item I would like to try to animate in HyperCard is a converted
> > > animated gif. Would page flipping be fast enough? Or some kind of
> > > animated sprite routine, like changing icons? I don't think HyperCard
> can
> > > change icons simultaneously since the animation is larger than 32x32.
> > >
> > > Thanks,
> > > Tom
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
[HC] Image Panning / Animation
(Msg 6 of 15)
DTS <daretospam@[redacted].com>
Thursday, 20-Sep-2012 23:13 GMT
I now see the image I want! Is it possible to make a button larger than
the size of a card? I expanded the button within the GUI, but now I cannot
drag it around.
Thanks,
Tom
On Thu, Sep 20, 2012 at 4:02 PM, Rebecca Bettencourt <beckiergb@[redacted].comwrote:
> You can't give it an icon of -1 from the GUI. You have to do it from
> HyperTalk. Bring up the message box and enter: set the icon of card button
> "foo" to -1
> On Sep 20, 2012 3:39 PM, "DTS" <daretospam@[redacted].com wrote:
>
> > **
> >
> >
> > Sounds exactly like what I need! How do I change the icon ID to -1? I
> > tried picking an icon and then selecting edit to change the ID number
> but I
> > got an error. I imported a PICT resource using resedit and gave it a name
> > (the PICT was converted from gif in Photoshop).
> >
> > Thanks,
> > Tom
> >
> > On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <
> beckiergb@[redacted].com> > >wrote:
> >
> > > Here's a trick that can be used to do either: set the name of the
> button
> > to
> > > the name of a PICT resource, and set its icon to -1 (yes, negative
> one).
> > > Now you have a button that displays the PICT. Then you can change its
> > name
> > > dynamically to do the animation, or add some mouse handlers to do
> > > click-and-drag (I believe there are some Readymade Buttons that will do
> > > that).
> > > On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
> > >
> > > > **
> > > >
> > > >
> > > > I am thinking about how to use larger images (1-bit) within the
> default
> > > > card size (512x384). One method is to have an image that sort of pans
> > > > around either automatically or with click and drag. What would be the
> > > best
> > > > way of doing this?
> > > >
> > > > Another item I would like to try to animate in HyperCard is a
> converted
> > > > animated gif. Would page flipping be fast enough? Or some kind of
> > > > animated sprite routine, like changing icons? I don't think HyperCard
> > can
> > > > change icons simultaneously since the animation is larger than 32x32.
> > > >
> > > > Thanks,
> > > > Tom
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > > >
> > > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> > >
[HC] Image Panning / Animation
(Msg 7 of 15)
DTS <daretospam@[redacted].com>
Thursday, 20-Sep-2012 23:21 GMT
Ok, I figured out set width/height of button "foo" to "720". It seems it
is bigger, but in button editing mode, I can't move it around. I'm
guessing with a "readymade" click and drag script I'll be able to?
Thanks,
Tom
On Thu, Sep 20, 2012 at 4:13 PM, DTS <daretospam@[redacted].com wrote:
> I now see the image I want! Is it possible to make a button larger than
> the size of a card? I expanded the button within the GUI, but now I cannot
> drag it around.
>
> Thanks,
> Tom
>
> On Thu, Sep 20, 2012 at 4:02 PM, Rebecca Bettencourt <beckiergb@[redacted].comwrote:
>
>> You can't give it an icon of -1 from the GUI. You have to do it from
>> HyperTalk. Bring up the message box and enter: set the icon of card button
>> "foo" to -1
>> On Sep 20, 2012 3:39 PM, "DTS" <daretospam@[redacted].com wrote:
>>
>> > **
>> >
>> >
>> > Sounds exactly like what I need! How do I change the icon ID to -1? I
>> > tried picking an icon and then selecting edit to change the ID number
>> but I
>> > got an error. I imported a PICT resource using resedit and gave it a
>> name
>> > (the PICT was converted from gif in Photoshop).
>> >
>> > Thanks,
>> > Tom
>> >
>> > On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <
>> beckiergb@[redacted].com>> > >wrote:
>> >
>> > > Here's a trick that can be used to do either: set the name of the
>> button
>> > to
>> > > the name of a PICT resource, and set its icon to -1 (yes, negative
>> one).
>> > > Now you have a button that displays the PICT. Then you can change its
>> > name
>> > > dynamically to do the animation, or add some mouse handlers to do
>> > > click-and-drag (I believe there are some Readymade Buttons that will
>> do
>> > > that).
>> > > On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
>> > >
>> > > > **
>> > > >
>> > > >
>> > > > I am thinking about how to use larger images (1-bit) within the
>> default
>> > > > card size (512x384). One method is to have an image that sort of
>> pans
>> > > > around either automatically or with click and drag. What would be
>> the
>> > > best
>> > > > way of doing this?
>> > > >
>> > > > Another item I would like to try to animate in HyperCard is a
>> converted
>> > > > animated gif. Would page flipping be fast enough? Or some kind of
>> > > > animated sprite routine, like changing icons? I don't think
>> HyperCard
>> > can
>> > > > change icons simultaneously since the animation is larger than
>> 32x32.
>> > > >
>> > > > Thanks,
>> > > > Tom
>> > > >
>> > > > [Non-text portions of this message have been removed]
>> > > >
>> > > >
>> > > >
>> > >
>> > >
>> > > [Non-text portions of this message have been removed]
>> > >
>> > >
>> > >
>> > >
[HC] Image Panning / Animation
(Msg 8 of 15)
Rebecca Bettencourt <beckiergb@[redacted].com>
Thursday, 20-Sep-2012 23:28 GMT
Yeah, if you want the button to be bigger than the card size, you'll have
to move and resize it with scripts instead of the button tool.
On Sep 20, 2012 4:21 PM, "DTS" <daretospam@[redacted].com wrote:
> **
>
>
> Ok, I figured out set width/height of button "foo" to "720". It seems it
> is bigger, but in button editing mode, I can't move it around. I'm
> guessing with a "readymade" click and drag script I'll be able to?
>
> Thanks,
> Tom
>
> On Thu, Sep 20, 2012 at 4:13 PM, DTS <daretospam@[redacted].com wrote:
>
> > I now see the image I want! Is it possible to make a button larger than
> > the size of a card? I expanded the button within the GUI, but now I
> cannot
> > drag it around.
> >
> > Thanks,
> > Tom
> >
> > On Thu, Sep 20, 2012 at 4:02 PM, Rebecca Bettencourt <
> beckiergb@[redacted].comwrote:
> >
> >> You can't give it an icon of -1 from the GUI. You have to do it from
> >> HyperTalk. Bring up the message box and enter: set the icon of card
> button
> >> "foo" to -1
> >> On Sep 20, 2012 3:39 PM, "DTS" <daretospam@[redacted].com wrote:
> >>
> >> > **
> >> >
> >> >
> >> > Sounds exactly like what I need! How do I change the icon ID to -1? I
> >> > tried picking an icon and then selecting edit to change the ID number
> >> but I
> >> > got an error. I imported a PICT resource using resedit and gave it a
> >> name
> >> > (the PICT was converted from gif in Photoshop).
> >> >
> >> > Thanks,
> >> > Tom
> >> >
> >> > On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <
> >> beckiergb@[redacted].com> >> > >wrote:
> >> >
> >> > > Here's a trick that can be used to do either: set the name of the
> >> button
> >> > to
> >> > > the name of a PICT resource, and set its icon to -1 (yes, negative
> >> one).
> >> > > Now you have a button that displays the PICT. Then you can change
> its
> >> > name
> >> > > dynamically to do the animation, or add some mouse handlers to do
> >> > > click-and-drag (I believe there are some Readymade Buttons that will
> >> do
> >> > > that).
> >> > > On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
> >> > >
> >> > > > **
> >> > > >
> >> > > >
> >> > > > I am thinking about how to use larger images (1-bit) within the
> >> default
> >> > > > card size (512x384). One method is to have an image that sort of
> >> pans
> >> > > > around either automatically or with click and drag. What would be
> >> the
> >> > > best
> >> > > > way of doing this?
> >> > > >
> >> > > > Another item I would like to try to animate in HyperCard is a
> >> converted
> >> > > > animated gif. Would page flipping be fast enough? Or some kind of
> >> > > > animated sprite routine, like changing icons? I don't think
> >> HyperCard
> >> > can
> >> > > > change icons simultaneously since the animation is larger than
> >> 32x32.
> >> > > >
> >> > > > Thanks,
> >> > > > Tom
> >> > > >
> >> > > > [Non-text portions of this message have been removed]
> >> > > >
> >> > > >
> >> > > >
> >> > >
> >> > >
> >> > > [Non-text portions of this message have been removed]
> >> > >
> >> > >
> >> > >
> >> > >
[HC] Image Panning / Animation
(Msg 9 of 15)
Uli Kusterer <Witness.of.TeachText@[redacted].net>
Thursday, 20-Sep-2012 23:29 GMT
On 20.09.2012, at 23:54, DTS <daretospam@[redacted].com wrote:
> I am thinking about how to use larger images (1-bit) within the default
> card size (512x384). One method is to have an image that sort of pans
> around either automatically or with click and drag. What would be the best
> way of doing this?
If you want to scroll a bigger picture (like a map), you can create a card that has the full size of the map, then do a
set the rect of card window to "100,100,612,442"
and then you can set the "scroll" property to move around the subsection of the window that is visible:
set the scroll of card window to "512,0"
will move right a screenful. (This is all from memory, so the syntax may be slightly off, but the general technique works, and works like this, at least in HyperCard 2.1 and later).
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.com
[HC] Image Panning / Animation
(Msg 10 of 15)
Colin Holgate <coiin@[redacted].net>
Thursday, 20-Sep-2012 23:53 GMT
I would tackle both things in a different way. You can use the Picture xcmd.. With that you can have a window that is smaller than the whole image, and you can scroll around the larger image. Also, you could set scroll positions fast enough to do the animated GIF effect. And it could all be in 24 bit color too.
[HC] Image Panning / Animation
(Msg 11 of 15)
DTS <daretospam@[redacted].com>
Friday, 21-Sep-2012 00:12 GMT
Thanks everyone for the good suggestions. I think I am close with
Rebecca's idea, but I'm not sure about the refresh rate since right now I
am using an emulator. One thing I am trying to add to the button dragging
is to limit the dragging so that the image does not come too much in bounds
and show the card background. Here is a script I am trying but it is not
working:
on mouseDown
repeat until the mouse is up
put "512,342,616,438" into limit
if the bottomRight of button "foo" is within limit then
show me at the mouseloc
end if
end repeat
end mouseDown
Thanks,
Tom
On Thu, Sep 20, 2012 at 4:21 PM, DTS <daretospam@[redacted].com wrote:
> Ok, I figured out set width/height of button "foo" to "720". It seems it
> is bigger, but in button editing mode, I can't move it around. I'm
> guessing with a "readymade" click and drag script I'll be able to?
>
> Thanks,
> Tom
>
>
> On Thu, Sep 20, 2012 at 4:13 PM, DTS <daretospam@[redacted].com wrote:
>
>> I now see the image I want! Is it possible to make a button larger than
>> the size of a card? I expanded the button within the GUI, but now I cannot
>> drag it around.
>>
>> Thanks,
>> Tom
>>
>> On Thu, Sep 20, 2012 at 4:02 PM, Rebecca Bettencourt <beckiergb@[redacted].com>> > wrote:
>>
>>> You can't give it an icon of -1 from the GUI. You have to do it from
>>> HyperTalk. Bring up the message box and enter: set the icon of card
>>> button
>>> "foo" to -1
>>> On Sep 20, 2012 3:39 PM, "DTS" <daretospam@[redacted].com wrote:
>>>
>>> > **
>>> >
>>> >
>>> > Sounds exactly like what I need! How do I change the icon ID to -1? I
>>> > tried picking an icon and then selecting edit to change the ID number
>>> but I
>>> > got an error. I imported a PICT resource using resedit and gave it a
>>> name
>>> > (the PICT was converted from gif in Photoshop).
>>> >
>>> > Thanks,
>>> > Tom
>>> >
>>> > On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <
>>> beckiergb@[redacted].com>>> > >wrote:
>>> >
>>> > > Here's a trick that can be used to do either: set the name of the
>>> button
>>> > to
>>> > > the name of a PICT resource, and set its icon to -1 (yes, negative
>>> one).
>>> > > Now you have a button that displays the PICT. Then you can change its
>>> > name
>>> > > dynamically to do the animation, or add some mouse handlers to do
>>> > > click-and-drag (I believe there are some Readymade Buttons that will
>>> do
>>> > > that).
>>> > > On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
>>> > >
>>> > > > **
>>> > > >
>>> > > >
>>> > > > I am thinking about how to use larger images (1-bit) within the
>>> default
>>> > > > card size (512x384). One method is to have an image that sort of
>>> pans
>>> > > > around either automatically or with click and drag. What would be
>>> the
>>> > > best
>>> > > > way of doing this?
>>> > > >
>>> > > > Another item I would like to try to animate in HyperCard is a
>>> converted
>>> > > > animated gif. Would page flipping be fast enough? Or some kind of
>>> > > > animated sprite routine, like changing icons? I don't think
>>> HyperCard
>>> > can
>>> > > > change icons simultaneously since the animation is larger than
>>> 32x32.
>>> > > >
>>> > > > Thanks,
>>> > > > Tom
>>> > > >
>>> > > > [Non-text portions of this message have been removed]
>>> > > >
>>> > > >
>>> > > >
>>> > >
>>> > >
>>> > > [Non-text portions of this message have been removed]
>>> > >
>>> > >
>>> > >
>>> > >
[HC] Image Panning / Animation
(Msg 12 of 15)
Rebecca Bettencourt <beckiergb@[redacted].com>
Friday, 21-Sep-2012 01:54 GMT
Here's a script that will let you drag a button inside a limited area:
on mouseDown
put "50,30,300,200" into limit
put the mouseH - the left of me into dx
put the mouseV - the top of me into dy
repeat while the mouse is down
put the mouseH - dx into x
if x < item 1 of limit then put item 1 of limit into x
if x > item 3 of limit then put item 3 of limit into x
put the mouseV - dy into y
if y < item 2 of limit then put item 2 of limit into y
if y > item 4 of limit then put item 4 of limit into y
set the topLeft of me to x, y
end repeat
end mouseDown
-- Rebecca Bettencourt
On Thu, Sep 20, 2012 at 5:12 PM, DTS <daretospam@[redacted].com wrote:
>
>
>
> Thanks everyone for the good suggestions. I think I am close with
> Rebecca's idea, but I'm not sure about the refresh rate since right now I
> am using an emulator. One thing I am trying to add to the button dragging
> is to limit the dragging so that the image does not come too much in
> bounds
> and show the card background. Here is a script I am trying but it is not
> working:
>
> on mouseDown
> repeat until the mouse is up
> put "512,342,616,438" into limit
> if the bottomRight of button "foo" is within limit then
> show me at the mouseloc
> end if
> end repeat
> end mouseDown
>
> Thanks,
> Tom
>
>
>
> On Thu, Sep 20, 2012 at 4:21 PM, DTS <daretospam@[redacted].com wrote:
>
> > Ok, I figured out set width/height of button "foo" to "720". It seems it
> > is bigger, but in button editing mode, I can't move it around. I'm
> > guessing with a "readymade" click and drag script I'll be able to?
> >
> > Thanks,
> > Tom
> >
> >
> > On Thu, Sep 20, 2012 at 4:13 PM, DTS <daretospam@[redacted].com wrote:
> >
> >> I now see the image I want! Is it possible to make a button larger than
> >> the size of a card? I expanded the button within the GUI, but now I
> >> cannot
> >> drag it around.
> >>
> >> Thanks,
> >> Tom
> >>
> >> On Thu, Sep 20, 2012 at 4:02 PM, Rebecca Bettencourt
> >> <beckiergb@[redacted].com> >> > wrote:
> >>
> >>> You can't give it an icon of -1 from the GUI. You have to do it from
> >>> HyperTalk. Bring up the message box and enter: set the icon of card
> >>> button
> >>> "foo" to -1
> >>> On Sep 20, 2012 3:39 PM, "DTS" <daretospam@[redacted].com wrote:
> >>>
> >>> > **
> >>> >
> >>> >
> >>> > Sounds exactly like what I need! How do I change the icon ID to -1?
> >>> > I
> >>> > tried picking an icon and then selecting edit to change the ID
> >>> > number
> >>> but I
> >>> > got an error. I imported a PICT resource using resedit and gave it a
> >>> name
> >>> > (the PICT was converted from gif in Photoshop).
> >>> >
> >>> > Thanks,
> >>> > Tom
> >>> >
> >>> > On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <
> >>> beckiergb@[redacted].com> >>> > >wrote:
> >>> >
> >>> > > Here's a trick that can be used to do either: set the name of the
> >>> button
> >>> > to
> >>> > > the name of a PICT resource, and set its icon to -1 (yes, negative
> >>> one).
> >>> > > Now you have a button that displays the PICT. Then you can change
> >>> > > its
> >>> > name
> >>> > > dynamically to do the animation, or add some mouse handlers to do
> >>> > > click-and-drag (I believe there are some Readymade Buttons that
> >>> > > will
> >>> do
> >>> > > that).
> >>> > > On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
> >>> > >
> >>> > > > **
> >>> > > >
> >>> > > >
> >>> > > > I am thinking about how to use larger images (1-bit) within the
> >>> default
> >>> > > > card size (512x384). One method is to have an image that sort of
> >>> pans
> >>> > > > around either automatically or with click and drag. What would
> >>> > > > be
> >>> the
> >>> > > best
> >>> > > > way of doing this?
> >>> > > >
> >>> > > > Another item I would like to try to animate in HyperCard is a
> >>> converted
> >>> > > > animated gif. Would page flipping be fast enough? Or some kind
> >>> > > > of
> >>> > > > animated sprite routine, like changing icons? I don't think
> >>> HyperCard
> >>> > can
> >>> > > > change icons simultaneously since the animation is larger than
> >>> 32x32.
> >>> > > >
> >>> > > > Thanks,
> >>> > > > Tom
> >>> > > >
> >>> > > > [Non-text portions of this message have been removed]
> >>> > > >
> >>> > > >
> >>> > > >
> >>> > >
> >>> > >
> >>> > > [Non-text portions of this message have been removed]
> >>> > >
> >>> > >
> >>> > >
> >>> > >
[HC] Image Panning / Animation
(Msg 13 of 15)
cubist94022 <Cubist@[redacted].com>
Friday, 21-Sep-2012 15:40 GMT
--- In HyperCard-Mailing-List, Rebecca Bettencourt <beckiergb@...> wrote:
>
> Here's a script that will let you drag a button inside a limited areaÂ
Rebecca's code will absolutely do the job -- but if response time is an issue, it may be worth trying different ways of achieving the same purpose, and testing them to see which is faster. In the current case:
on mouseDown
put "50,30,300,200" into limit
put the mouseH - the left of me into dx
put the mouseV - the top of me into dy
repeat while the mouse is down
put the mouseH - dx into x
-- if x < item 1 of limit then put item 1 of limit into x
-- if x > item 3 of limit then put item 3 of limit into x
put max ((item 1 of limit, min ((item 3 of limit), x)) into x
put the mouseV - dy into y
-- if y < item 2 of limit then put item 2 of limit into y
-- if y > item 4 of limit then put item 4 of limit into y
put max ((item 2 of limit, min ((item 4 of limit), y)) into y
set the topLeft of me to x, y
end repeat
end mouseDown
What I've done here is replace two IF statements, four "item N of Whatever" references,and two "put A into B" assignments, with one MAX function, one MIN function, two "item N of Whatever" references, and one "put A into B" assignment. I believe this will speed up the code a bit, but I recommend that you try both Rebecca's original code and my modified version, to confirm whether or not there's any actual speed difference on your system. Even if my modified version is faster, you may find Rebecca's original version to be sufficiently easier to understand that the speed gain (if any) isn't worth the hassle. So again, try 'em both and see!
[HC] Image Panning / Animation
(Msg 14 of 15)
Muaadh Salih <ms1@[redacted].uk>
Friday, 21-Sep-2012 17:08 GMT
There an excellent section in "Coulouris & Thimmbleby , *Hyper
programming*, sec. 1.5 " on direct manipulation and Dragging a window
button within HC
windows.
It also thoroughly explain everthing related to this topic
Muaadh
[HC] Image Panning / Animation
(Msg 15 of 15)
DTS <daretospam@[redacted].com>
Saturday, 22-Sep-2012 00:19 GMT
Thanks Rebecca, this technique works well and avoids having the button's
center jump to where it was clicked, which is more noticeable with such a
large button. I tweaked some of the numbers in the limit, but otherwise it
worked well. I tested it with an SE/30 and the speed was good.
Another thing I tried was a script to pan the button around automatically.
It was pretty slow though on an SE/30. If I increase the step size it
gets faster but is not as fluid looking. I'm thinking it can be faster
since I can pan with a mouse faster with fairly fluid motion. What's also
strange is one image works faster than the other even though they are the
same dimensions. Here's an excerpt:
set the topLeft of button "foo" to -208,1
put -208 into NewLoc
repeat until NewLoc >= 1
put NewLoc + 6 into NewLoc
set the topLeft of button "foo" to NewLoc,1
end repeat
Thanks,
Tom
On Thu, Sep 20, 2012 at 6:54 PM, Rebecca Bettencourt <beckiergb@[redacted].comwrote:
> Here's a script that will let you drag a button inside a limited area:
>
> on mouseDown
> put "50,30,300,200" into limit
> put the mouseH - the left of me into dx
> put the mouseV - the top of me into dy
> repeat while the mouse is down
> put the mouseH - dx into x
> if x < item 1 of limit then put item 1 of limit into x
> if x > item 3 of limit then put item 3 of limit into x
> put the mouseV - dy into y
> if y < item 2 of limit then put item 2 of limit into y
> if y > item 4 of limit then put item 4 of limit into y
> set the topLeft of me to x, y
> end repeat
> end mouseDown
>
> -- Rebecca Bettencourt
>
>
> On Thu, Sep 20, 2012 at 5:12 PM, DTS <daretospam@[redacted].com wrote:
> >
> >
> >
> > Thanks everyone for the good suggestions. I think I am close with
> > Rebecca's idea, but I'm not sure about the refresh rate since right now I
> > am using an emulator. One thing I am trying to add to the button dragging
> > is to limit the dragging so that the image does not come too much in
> > bounds
> > and show the card background. Here is a script I am trying but it is not
> > working:
> >
> > on mouseDown
> > repeat until the mouse is up
> > put "512,342,616,438" into limit
> > if the bottomRight of button "foo" is within limit then
> > show me at the mouseloc
> > end if
> > end repeat
> > end mouseDown
> >
> > Thanks,
> > Tom
> >
> >
> >
> > On Thu, Sep 20, 2012 at 4:21 PM, DTS <daretospam@[redacted].com wrote:
> >
> > > Ok, I figured out set width/height of button "foo" to "720". It seems
> it
> > > is bigger, but in button editing mode, I can't move it around. I'm
> > > guessing with a "readymade" click and drag script I'll be able to?
> > >
> > > Thanks,
> > > Tom
> > >
> > >
> > > On Thu, Sep 20, 2012 at 4:13 PM, DTS <daretospam@[redacted].com wrote:
> > >
> > >> I now see the image I want! Is it possible to make a button larger
> than
> > >> the size of a card? I expanded the button within the GUI, but now I
> > >> cannot
> > >> drag it around.
> > >>
> > >> Thanks,
> > >> Tom
> > >>
> > >> On Thu, Sep 20, 2012 at 4:02 PM, Rebecca Bettencourt
> > >> <beckiergb@[redacted].com> > >> > wrote:
> > >>
> > >>> You can't give it an icon of -1 from the GUI. You have to do it from
> > >>> HyperTalk. Bring up the message box and enter: set the icon of card
> > >>> button
> > >>> "foo" to -1
> > >>> On Sep 20, 2012 3:39 PM, "DTS" <daretospam@[redacted].com wrote:
> > >>>
> > >>> > **
> > >>> >
> > >>> >
> > >>> > Sounds exactly like what I need! How do I change the icon ID to -1?
> > >>> > I
> > >>> > tried picking an icon and then selecting edit to change the ID
> > >>> > number
> > >>> but I
> > >>> > got an error. I imported a PICT resource using resedit and gave it
> a
> > >>> name
> > >>> > (the PICT was converted from gif in Photoshop).
> > >>> >
> > >>> > Thanks,
> > >>> > Tom
> > >>> >
> > >>> > On Thu, Sep 20, 2012 at 3:02 PM, Rebecca Bettencourt <
> > >>> beckiergb@[redacted].com> > >>> > >wrote:
> > >>> >
> > >>> > > Here's a trick that can be used to do either: set the name of the
> > >>> button
> > >>> > to
> > >>> > > the name of a PICT resource, and set its icon to -1 (yes,
> negative
> > >>> one).
> > >>> > > Now you have a button that displays the PICT. Then you can change
> > >>> > > its
> > >>> > name
> > >>> > > dynamically to do the animation, or add some mouse handlers to do
> > >>> > > click-and-drag (I believe there are some Readymade Buttons that
> > >>> > > will
> > >>> do
> > >>> > > that).
> > >>> > > On Sep 20, 2012 2:54 PM, "DTS" <daretospam@[redacted].com wrote:
> > >>> > >
> > >>> > > > **
> > >>> > > >
> > >>> > > >
> > >>> > > > I am thinking about how to use larger images (1-bit) within the
> > >>> default
> > >>> > > > card size (512x384). One method is to have an image that sort
> of
> > >>> pans
> > >>> > > > around either automatically or with click and drag. What would
> > >>> > > > be
> > >>> the
> > >>> > > best
> > >>> > > > way of doing this?
> > >>> > > >
> > >>> > > > Another item I would like to try to animate in HyperCard is a
> > >>> converted
> > >>> > > > animated gif. Would page flipping be fast enough? Or some kind
> > >>> > > > of
> > >>> > > > animated sprite routine, like changing icons? I don't think
> > >>> HyperCard
> > >>> > can
> > >>> > > > change icons simultaneously since the animation is larger than
> > >>> 32x32.
> > >>> > > >
> > >>> > > > Thanks,
> > >>> > > > Tom
> > >>> > > >
> > >>> > > > [Non-text portions of this message have been removed]
> > >>> > > >
> > >>> > > >
> > >>> > > >
> > >>> > >
> > >>> > >
> > >>> > > [Non-text portions of this message have been removed]
> > >>> > >
> > >>> > >
> > >>> > >
> > >>> > >
HyperCard® and HyperTalk™ remain trademarks of Apple, Inc.; other trademarked products and terms mentioned in this archive are the property of their respective trademark holders. Individual messages remain the intellectual property of their respective authors.