hdnine's Recent Forum Activity

  • I have been reading about this for the last hour now and no matter what i try i can't get the Browser-object's "Request fullscreen" to trigger. At first i thought it might be other things in my project code that prevented this from working, so i tried a blank document with only this object present.

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

    Clearly I must be doing something wrong because I've tried it on my PC with both Firefox and Chrome and on my Galaxy S4 with Chrome, all latest versions... <img src="smileys/smiley7.gif" border="0" align="middle" />

    Now I've seen pages before that do request fullscreen so i know it works in my browser. I also performs just fine if i press F11. Any help would be appreciated. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I finally found out what the problem was. My function for calculating the nearest object was just fine. The issue was in the fact that, when setting the current target, i only did this at one time and never kept updating the "currentTarget" X and Y positions.

    Because of this, nearest target was only calculated on time. Thanks for anyone reading this post! ^^

  • I have an issue which i can seem to solve. The function that i am using is to calculate which of all module-objects are closest to the current target you are dragging.

    To test it i have tried different debug texts and i even set the nearest target opacity to 50. The crazy thing is that the function seems to work... but only one time and this is what i can't figure out. While I'm dragging, why doesn't the nearest target update? It only does it one time when i start the drag event.

    It's probably something simple but I've been staring at this code since yesterday and i can't find what's wrong. <img src="smileys/smiley26.gif" border="0" align="middle" />

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

    The code enters the function over and over but the nearest target seems to only be set once. Anyways, any help would be awesome.

  • the Dragdrop enabled just mean that drag and drop is now possible for that module. Not that you will start dragging it.

    You will probably have to make your own drag and drop, but it is not that hard.

    just set module.x to mouse.x and module.y to mouse.y while dragging.

    Right as i suspected... thanks <img src="smileys/smiley36.gif" border="0" align="middle" />

  • Regarding posting links you need a certain rep-rating for them to work. So new or inactive members to the forum can't post links. Have the same issue. ^^

  • I find myself trying to find a solution to perhaps an obvious problem? I have some code that enabled drag&drop after pressing the mouse down on an object for 0.5 sec. I've verified that it works since both a test scaling of the object works, as well as checking for the "Is enabled" condition.

    The problem is that the drag event doesn't take effect until i release the button and click & drag again. I need it to start following the mouse immediately so is there anyway for the built in behavior to work or do i need to write custom code?

    This is the current setup:

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

    On a side note this forum seems to have an issue with me taking too long time to write my topics since it gives me an error every time that my session time is up. >.<

  • 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! ^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • Ok thanks everyone ^^

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

hdnine's avatar

hdnine

Member since 10 Jul, 2013

None one is following hdnine yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies