ranma's Forum Posts

  • try

    body {
        background-image: url('iPhone.gif');
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: center center
    }
    

    or simply try a shorthand

    body {background: url(iPhone.gif) center center no-repeat}
    
  • How do I make sound to work in phonegap. I read somewhere that since some version of C2 audio object uses phonegap's audio for playback, but I can't get any sound to play after export. Is there something extra I must do? Thanks in advance.

  • No, not yet - right now a plugin's the best way to do it, but I was hoping to add a feature to the Browser object in future to do this.

    pardon for digging this up, but I was searching for this and it turns out you can actually use the browser object:

    Go To Url action:

    "javascript:alert('hello world');void(0);"

  • What model phone did you try on and what version of Android? The phone might have an accelerometer but not expose it though the browser.

    nexus one, android 2.3.6

    the browser I can understand, but as a native phonegap app, it should work as intended.

  • I tried this on android, which HAS the accelerometer, but didn't work. Am I doing something wrong or is it a bug? Done with phonegap export.

    CAPX: dl.dropbox.com/u/59009902/motiontest.capx

    APK: dl.dropbox.com/u/59009902/Newproject-debug.apk

  • when renaming animation and pressing enter the one that I as renaming stays at "Animation2" and the first one is renamed to what I intended to rename Animation2 to. hard to describe, but i bet it happens to everyone who creates sprites with lots of animations.

  • ranma: dld again the previous capx.

    I cheated using opacity.

    It is a good question though, using the visible property with a conditionnal operator.

    I'm not sure it can be done. If it can, I'd love to know how to.

    For that one though, there's a trick/workaround to use a temp variable.

    The code you first gave would look like :

    on touch end
    -- object is visible?
    -- tVar = 0
    ++++ make object invisible
    ++++ tVar = 1
    -- object is invisible?
    -- tvar = 0
    ++++ make object visible
    ++++ tVar = 1
    

    This stops the "looping" effect.

    great, here's the exact code that worked, has to be inside a group as local variables can only be applied inside groups:

    -----------------
    group: clicking
    -----------------
    local number clickloop = 0
    
    on touch end: clickloop = 0
    -- object is visible?
    -- clickloop == 0?
    ++++ make object invisible
    ++++ set clickloop = 1
    -- object is NOT visible?
    -- clickloop == 0?
    ++++ make object visible
    ++++ set clickloop = 1
    

    hope it helps someone, thanks Kyatric

  • ranma: capx

    ?: is a conditional operator, which allows you to test conditions in expressions.

    i know, but how do you use it with visibility and others. thanks for the response, but this does not apply, or at least i don't know how to use this operator with "make visible / invisible". also I need to retain this event structure, as this is a simplified version of my real problem.

  • quick question, I have a button that toggles visibility of an object, in events:

    on touch end

    -- object is visible?

    ++++ make object invisible

    -- object is invisible?

    ++++ make object visible

    this of course loops itself through fully, because the object will be hidden by the first subevent and shown by second one. how to avoid this so it kinda breaks after making it invisible?

  • what I'm trying to accomplish is to send to all players currently running a c2 game a short message. I have their ip numbers. the message can go through php server I have there, Java server is not an option. Is this possible?

    tldr: superbasic chat where there is a php/mysql server keeping only ip's.

  • And finaly you have a function third-party plugin.

    List of third party behaviors and plugins.

    <img src="smileys/smiley4.gif" border="0" align="middle">

    oh wow. i'm blind :)

  • > - On object created (I'd like to run this event after object was created to set its rotation to random for example). Is on screen + trigger once while true does the same, but for a large number of sprites this isn't good as it checks every tick for on screen, does it?

    Actually, after having used "system:create object", the newly made object is picked.

    imagine you create the same explosion in 20 events and wish not only to set the random angle, but also do 20 other things with the new sprite :)

    which reminds me, some kind of OR would be great, or functions like in classic, function createExplosion(x,y) {} and run it every time something is destroyed. in the function would be all the random angle, etc.

  • bought myself a license, so time to test and bump this topic a bit :)

    changed the title a little, so it matches to the content.

    to the point:

    • On object created (I'd like to run this event after object was created to set its rotation to random for example). Is on screen + trigger once while true does the same, but for a large number of sprites this isn't good as it checks every tick for on screen, does it?
    • I cannot inline edit action values in event editor :(
    • When editing action value, when selecting text, the selection behaves strangly, it selects more than I want (kinda like it was selecting the whole "words")
    • There should me more clear info on the origin setting that when you click while holding shift, it'll set the origin in the clicked point for the whole animation, which I guessed from the shift+crop which is explained when you hover over the crop button.

    these are my first impressions from todays full version testing, probably will come back with more :)

    also, go scirra, go! :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • <img src="smileys/smiley27.gif" border="0" align="middle" />

  • Little things (not big functionalities like shaders) that made your game creation easy in CC and are not present in C2. ITT i propose everyone to write one function that should be easy and quick for developers to implement and would make gamemakers' (pun not intended) work easier.

    I'll start.

    system expression: Clamp(number,min,max) - returns number clamped by min and max parameters.

    of course I can use max(dest_min, min(dest_max, number)) but clamp was a little thing that did it for me and it was cleaner than this.

    hope that thread contributes to the development somehow. thanks and keep on rocking, scirra!