hdnine's Forum Posts

  • Ok thanks... makes sense i guess not worrying about it

  • I've been wondering over something which i scoured the forums for and it has to do with optimization. Currently I'm working on a radial menu system for my game, which oddly enough is the first thing i tackled when trying to learn C2.

    Right now i create all menu objects "on start of layout" and position them off-screen. When they are needed i simply position them on the "stage" and when they are no longer required, i move them back off-screen. While doing this a thought struck me that having too many objects might slow down the system?

    According to http://www.scirra.com/manual/134/performance-tips, off-screen objects aren't rendered but i still wanted to hear your opinion on this.

    Is it better to create the menu objects when they are needed, position them and the destroy them when not needed?

    OR

    Create them "on start of layout" and position them off-screen, move them them when needed and then back again?

    In the provided link they also state that "the GPU is also smart enough to know not to render any content that appears outside the window - even when a single image is only partially on-screen". So how does partly visible images affect performance? Right now i position menu objects by using "-module.Width" and "-module.Height" which basically puts them right off-screen. Is it safer to put them at "-1000" or something to ensure them not being partially visible?

    Thanks! ^^

  • I see... understand now thanks. Didn't realize it was an index number instead of a name the parameter uses. Thanks! ^^

  • I've been struggling with this programs for a week now and I'm amazed how hard it still is to understand. I have JavaScript background and understand most parts of OOP.

    I'm trying to grasp how functions work and in any ordinary programming language you can pass in arguments and then use them inside the called function as parameters. For example:

    function setTarget(uid) {

    currentTarget = uid;

    }

    setTarget(id);

    In C2 i call a function with a specific name and add a "parameter" (which i guess should be "argument") with the current uid. Inside the function however i wish to use the parameter but have no clue on how to do that?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok thanks everyone ^^

  • Ya ok thanks. Families sounded like the feature i needed...

  • I just realized that some of the limitations set on the free version presents a problem, especially for me to decide if i want to buy a license or not. Granted, i am new to this program but i was fiddling with a radial menu where, when i click on an object, X number of menu elements should appear.

    This is where the limited "families" feature would have come in handy as i understand it?

    I wanted to group all menu options into a family and having the whole family being affect with things like visibility or mouse hover checks. Instead i am forced to "write" code for every single menu object and that really sucks. How am i supposed to make a decision on if whether or not i want to buy the product if i can't try essential features?

    A radial menu toggle is a key feature in the game me and my friend is planning so this would have been nice to try out. Then again, maybe I'm wrong about families and you can have a set of objects appear at the same time when another object is clicked?

  • Hey everyone!

    This will be my first post and I'm very excited about creating my own game. I have some previous JavaScript experience but it's been a while. Anyway, at the moment I'm trying to understand how functions work in C2 but i can't seem to get a grip on some things.

    Below you will find an image of my current test. Basically what I'm trying to do is to have a toggle function. When an object is clicked, it will call a function which will fade in another object (an image, some text or whatever). If the object already is visible, i want it to fade out... easy right?

    <img src="http://i.imgur.com/I5d7fu7.png" border="0" />

    So my problem is this. I want to pass three values into the function, the target object, the fade in time and the fade out time. These should set the the target objects behavior fields to those values. So in order to get it to work i have been struggling to understand how the functions work in C2.

    If i have a function object and set its name as fadeToggle, is this the same as:

    function fadeToggle(targetObj, in, out)

    {

        // set fade in and out values

    }

    OR

    var fadeToggle = function(targetObj, in, out)

    {

        // set fade in and out values

    }

    Aren't these then set in GLOBAL scope? What i want to do is have something similar to this:

    var gameObject = {

        fadeInTime: 0,

        fadeOutTime: 0,

        fadeToggle: function(targetObj, in, out) {

              // set fade in and out values

        }

    };

    Anyway, after trying for a while i can get an object to appear when i click a button and then disappear when i click it again, but not with proper fading. It fades in and out alright. But then when i click it again nothing happens. Both are set as "restart fade".