pulpcore
[Prev] Thread [Next] | [Prev] Date [Next]
Re: Confusing behaviour with Timeline.animate(..) Dorian Cussen Wed Jun 10 00:00:46 2009
So shouldnt the above code work then as desired?
2009/6/9 David Brackeen <[EMAIL PROTECTED]>
> A change in a group's property doesn't change the child sprite's
> properties, but rather it transforms the child sprite's display. So
> changing the group's alpha does affect the display of all it's child sprites.
>
>
> On Tue, Jun 9, 2009 at 12:13 AM, Dori <[EMAIL PROTECTED]>wrote:
>
>>
>> Thanks for the reply. I was under the impression when you manipulate a
>> groups graphical property that it would propergate the change down to
>> all children of that group, is this an incorrect assumption?
>>
>> Thanks,
>>
>> Dori
>>
>> On Jun 8, 3:00 pm, David Brackeen <[EMAIL PROTECTED]> wrote:
>> > I think you can get the effect you're looking for by giving the Group a
>> > backbuffer. group.createBackBaffer()That way the alpha is only applied
>> to
>> > the Group's back buffer, not each individual sprite.
>> >
>> > On Mon, Jun 8, 2009 at 2:22 AM, Dori <[EMAIL PROTECTED]>
>> wrote:
>> >
>> > > Hello, i thought i was getting the hang of pulpcore until I get
>> > > stumped by something very simple. Using the example below, the
>> > > button's alpha setting animates correctly, over the 10 secs (just as
>> > > example) but the image sprite seems to do it at 3 times the speed,
>> > > whats going on here?!
>> >
>> > > Thanks for any help, code follows...
>> >
>> > > public class InstructionsScene extends Scene2D {
>> > > private Button menuBut;
>> > > private Group only;
>> > > private ImageSprite im;
>> >
>> > > @Override
>> > > public void load() {
>> > > only = new Group();
>> > > Timeline tl = new Timeline();
>> >
>> > > //background
>> > > im = new
>> > > ImageSprite(CoreImage.load(Imaging.INSTRUCTIONS),0,0);
>> > > only.add(im);
>> >
>> > > //button
>> > > menuBut = new
>> Button(CoreImage.load(Imaging.MENU_BUT).split(3),
>> > > (Stage.getWidth() / 2),
>> > > 450);
>> > > menuBut.setAnchor(0.5, 0.5);
>> > > only.add(menuBut);
>> >
>> > > tl.animate(only.alpha, 0, 255, 10000);
>> >
>> > > add(only);
>> > > addTimeline(tl);
>> >
>> > > }
>> >
>> > > @Override
>> > > public void update(int elapsedTime) {
>> >
>> > > if (menuBut.isMousePressed()) {
>> > > Timeline nST = new Timeline();
>> > > nST.interruptScene(new MenuScene(), 100);
>> > > addTimeline(nST);
>> > > }
>> > > }
>> > > }
>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PulpCore" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pulpcore?hl=en
-~----------~----~----~----~------~----~------~--~---
- Confusing behaviour with Timeline.animate(..) Dori
- Re: Confusing behaviour with Timeline.animate(..) David Brackeen
- Re: Confusing behaviour with Timeline.animate(..) Dori
- Re: Confusing behaviour with Timeline.animate(..) David Brackeen
- Re: Confusing behaviour with Timeline.animate(..) Dorian Cussen <=
- Re: Confusing behaviour with Timeline.animate(..) David Brackeen