Noncentz705's Forum Posts

  • You do not have permission to view this post

  • The node-webkit docs suggests Enigma Virtual Box. 'It's free for personal and commercial use. '

    I've used it and it seems to work fine.

  • not a problem, glad I could help.

  • project was saved with a new version

    [attachment=0:2idkg6lv][/attachment:2idkg6lv]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • no need, just give an id in the project properties bar and add the browser object to your project for the js statement.

    Similar question here and why the opacity idea is better choice

  • Can't play with the z-order, but you could give an opacity of 0 with css, then you'd only see the sprite that's underneath. Or leave the FileChooser outside of layout and Sprite on click Browser Execute Js File_Chooser_id.click();

  • Joannesalfa it look's like the '' are the problem

    Global text global_text = 'Some value'

    "var hold = "&"'"&global_text&"';"&"; window['my_input_id'].value = hold;"

    not sure why i had to escape it like that

  • Joannesalfa, not annoyed just busy. If you can't figure things out maybe someone else can help while I'm gone?

    Quick answer for now... make an input in c2, set id my_c2input, and give on click event with event sheet

    example on clicked call my_callback_function

    Then with your other input (the one not inside c2) have it click my_c2input by giving it an onclick="my_c2input.onclick();" either inline or with javascript.

    and about the callFunc code just open browser console and test a bit or ignore it for now. Sorry can't help more right now.

  • If you have any suggestions or encounter any bugs please let me know.

  • Only difference is that callFunc is assigned to window['callFunc'], anything after the = sign is the same. If you can't figure it out I can remake the capx... I hadn't saved it before.

    Question about return values

    On Start of layout ('or make the element in index.html after export '

    "var d= document.createElement('div'); d.id =  'my_div';  document.body.appendChild(d);
          d.onclick = function(){return 'SOME_VALUE';}
    "
    [/code:2b3g97st]
    When you want return value 
             Text set text to [code:2b3g97st]Browser.ExecJS("(function callback(){return my_div.onclick();})();")[/code:2b3g97st]
  • Joannesalfa maybe an easier way to trigger functions from the page would be to create a button in your c2 project give it an id and on click do something.. Then with js you should be able to call that event with id_name.click(); A lot less code lol

  • Input :

    A custom input element - type could be radio, checkbox, color, text, password, email ...

    • ... Inputs can be clicked with events
    • ... can be assigned attributes - > input set Attribute 'type' = 'color'
    • ... can compare attribute to help with selections
    • ... can fire an on change event - > i.e suitable for getting color from input
    • ... can append multiple css properties with one action
    • ... can be rotated or fade ...

    Newest v1.08: DOWNLOAD (July 23rd)

    Old versions: Just ask

    Recent additions :

    Actions

    • Insert text index
    • Set className
    • Set id
    • Set z-index

    Expressions

    • id
    • className
    • selectionStart
    • selectionEnd
    • zIndex

    Editor

    • CSSText

    Debugger

    • Stylesheet text

    DEMO

    CAPX EXAMPLE

    • First part about getting and setting variables.
    • Setting variable example :

      On some event Execute javascript "(function(){window.foo = 'something'})()"[/code:wl21003j]
    • Getting variable example :

      On some event set text to Execute Javascript "(function(){return window.foo;})()"[/code:wl21003j]

    Then about the callFunc part it maybe the picture will explain better ...

    > [attachment=0:wl21003j][/attachment:wl21003j]

  • Joannesalfa , it's not code for a plugin but instead something you would add to the page your game sits on to trigger c2 functions. A quick example :

    • Make a c2 project that has a function named 'callback'
    • After exporting the project, add the js from above to index.html, and then you can call the 'callback' with callFunc('callback')

    However it sounds like you're trying to do the opposite and update an element of the page your game sits on from c2;

    If that's the case then you don't need the code, just use the browser object and execute js.

    Example :

    ...  <p id='my_tag'>{{PlaceHolder}}</p> ....[/code:3u6olnub]
    Browser Execute JavaScript "my_tag.innerHTML = 'New Content'"
  • Are you trying to call a c2 function from the page your game is embedded on?

    -- REMOVED --
    [/code:1qbwhd75]
    [ul]
    [li]0 : Function Name ('String')[/li]
    [li]1 : Function Arguments ('Array' & 'Optional')[/li]
    [li]2 : Function Object Name ('String' & 'Optional') -> usually 'Function' unless renamed[/li]
    [li]3 : Frame Object ('Object' & 'Optional') -> if you embed your game pass a reference to the iframe[/li][/ul]
    
    -Add Function object to your project and add a new Function ... i.e : 'callback'; 
    then call it from the page with callFunc('callback');