Pyro 2 Questions

Home Forums Monkey 2 Programming Help Pyro 2 Questions

This topic contains 16 replies, has 3 voices, and was last updated by  therevills 2 months, 2 weeks ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #10021

    therevills
    Participant

    Hey Playniax – so I’ve finally got around to play with Pyro 2 and got a couple of questions so far 🙂

    * Is delta timing needed for the scene graph object?
    * Why 2 different modules for Pyro-Framework and Pyro-SceneGraph? Just trying to get my head around which on to use and where…
    * How would a create a GUI layer so it doesnt move with the camera? For example I’m playing with the shadowcaster example and would like the LayerLabel not to move with the camera?

    [/crayon]

    Or should I be doing something different?

    #10025

    Playniax
    Participant

    Is delta timing needed for the scene graph object?

    No

    Why 2 different modules for Pyro-Framework and Pyro-SceneGraph?

    When is started Pyro2 I attempted to have one module for both but found that having ‘specialised’ modules just worked better.

    Just trying to get my head around which on to use and where…

    I generally use the Scenegraph for game / sprite oriented stuff and GUI module for buttons, labels, etc as an overlay.

    Not a fixed set of ‘rules’ but the examples reveal my personal preference.

    How would a create a GUI layer so it doesnt move with the camera? For example I’m playing with the shadowcaster example and would like the LayerLabel not to move with the camera?

    In your particular example you can add and extra layer and set the layer MultiplierX and MultiplierY to 0. The layers X and Y positions are multiplied by the camera X and Y and by the Multiplier X and Y values so you can create a parallax scrolling effects by changing the values. Setting them to 0 will cause the layers not to move when you move the camera.

    #10061

    therevills
    Participant

    Thanks Tony!

    So much code to look thru!

    From what you are suggesting I should use the gui module for the overlay instead of the layer?

    With the screen manager is there a way to have transitions (eg fade between them)?

    Edit: Should I be using screens or scenes? O_O

    #10071

    Playniax
    Participant

    Did you go thru the modules bananas? Step by step they should clear things up. I attempted to keep them as minimum as possible to expose diffrent parts of the framework…

    Anyway, a screen and a scene are not the same. You can use the screen manager and screens like the monkey Window class except you can set up multiple screens and switch easily between them. From a screen OnUpdate and OnRender you can update and draw a scene.

    Also have a look at the ‘t01_screens’ template in the Pyro essentials found here

    For fading you can use the DrawFader( canvas,value ) command.

    The jungle.monkey2 demo in the essentials zip show you how its done.

    I did recently start a series of tutorials that I want to update regulary so hopefully this will help!

    Here are the humble beginnings!

    I added the scene graph basics today!

    #10098

    therevills
    Participant

    The Jungle example is perfect, this should be in your examples folder! I was having a hard time with the Screen and adding a Scene… in the example you have:

    scene=New Scene( ScreenManager )

    I must be rusty in MX2 as how does that even work? You are passing a class to scene not an instance of a class???

    When declaring screens is the last one instantiated the first one to be shown?

    I’ve added fading to the Jungle demo example, but is there an easier way with the framework?

    https://pastebin.com/sLBrce9g

    (I couldnt paste the code here)

    #10103

    nerobot
    Participant

    You are passing a class to scene not an instance of a class???

    Just press F2 on ScreenManager and jump to declaration. You’ll see that

    yes! mx2 allow us naming variables the same as classes, so we can be surprised sometimes. 🙂

    (this lang feature prevents me to do code jumping properly – especially in such cases)

    #10107

    Playniax
    Participant

    Nerobot to the resque!

    The scene must know its Window or in this case the ScreenManager ( the ScreenManager is an extension of the monkey2 Window class ).

    The Jungle example is perfect, this should be in your examples folder!

    At the time the module manager zip file limit was only 2 mb? I was forced to split it up a bit. I think mark changed it to 5? I should have a look at that. Maybe a lot of people missed the cool stuff.

    When declaring screens is the last one instantiated the first one to be shown?

    Yes, but you can control it with the Set command.

    I’ve added fading to the Jungle demo example, but is there an easier way with the framework?

    Not at this time really

    Thing is, with Igntition and Pyro I learned that to much predetermined stuff keeps devs boxed in ( doing things my way ) that I tried to keep things as open and flexible as possible.

    I might write a transitions lib that deals with this automatically like Ignition has but a bit more open.

    #10114

    therevills
    Participant

    Thanks Nerobot… I didnt think to pressed F2, I just thought it was the class! D’oh! That does make reading code a bit harder!

    Thanks again Tony for the info.

    A transition lib would be great, adding fading betweening screens makes games look so much more professional.

    I might have missed but is Pyro2 source opensource on GitHub or similar?

    #10120

    Playniax
    Participant

    I might have missed but is Pyro2 source opensource on GitHub or similar?

    Pyro is opensource but not on GitHub ( yet )

    No experience with GitHub sharing / merging etc. Still on my todo list to have a go.

    #10263

    therevills
    Participant

    Possible bug, run the b05_shadowcaster demo and then maximise the window. The position of the light sprite is drawn incorrectly.

    #10273

    Playniax
    Participant

    Thanks! It looks like a bug in the banana, not Pyro. The banana uses a virtual resolution but the ‘real’ mouse values. I will update the banana  asap!

    #10279

    therevills
    Participant

    Ah… I’m trying to do something similar whats the fix?

    Also what you suggest on getting Canvas details in the OnUpdate method, for example canvas.Viewport.Width?

    And currently we cant pass in a texture flag to GetBump in the content manager, I’ve added to my version of pyro-framework:

    [/crayon]

    Hmmm looks like all the Content resources you cant set a texture flag unless I’ve missed something…

    I’ve also added a OnPostRender method in screenmanager’s Screen class:

    [/crayon]

    Which is called by ScreenManager OnRender method:

    [/crayon]

    This allows me to add extra stuff such as a fader etc.

    Is there a better place to discuse these changes or are you happy with this thread?

    #10281

    Playniax
    Participant

    whats the fix

    Will post that later

    currently we cant pass in a texture flag to GetBump in the content manager

    I see. Or I missed it or Mark added it recently not sure. Anyway, will try to add that.

    Is there a better place to discuse these changes or are you happy with this thread?

    Maybe some kind of more direct communication is needed because I am interested in what the ‘Diddy guy’ thinks that should be added. I use Slack, Skype or do you have a suggestion except for github.

    #10284

    Playniax
    Participant

    There are basically 2 correct ways to get the mouse coords when a virtual resolution is used or the camera zooms in/out/rotates.

    or

    what you suggest on getting Canvas details in the OnUpdate method

    For now, the canvas size is always the same as the window size ( or view ). You can also call camera.View.Width or camera.View.Height

    I will change this in the future because I want to be able to render the scene to an image larger or smaller as the default canvas and at the time I coudn’t decide the best approach on passing the width and height to the update part. But I think for now your safe to get the window or camera sizes…

    #10357

    therevills
    Participant

    Hmmm tried both:

    [/crayon]

    Doesnt fix the issue…

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.