resdesign's Forum Posts

  • Can anyone help on this one.?

    Something strange happens :

    If I start with the mouse event, the button do not switch. However if I start with the T key (which is working) and then proceed to use the mouse it switches. So it seems that the trigger for the mouse event when chosen first is not firing properly.

    Note: the only reason I am doing both events is that specs for education covers all kind of special needs. Most students will use the mouse or tap events while some will use the keyboard.

  • I still have a problem though the code is definitely better. Basically the button works only on one of the event (the rest works)

    The reason I need both is because some students will use only the keyboard and some students will use touch or mouse. I used mouse in the example but of course I could replace with touch which would also both mouse and tap.

    case 1:

    on start layout set trailOnOff = 1

    on trailONoff = 0/ set animation frame to 0

    else/ set animation frame to 1

    result: keyPress changes the button - mouse does not

    case 2:

    on start layout set trailOnOff = 1

    on trailONoff = 0/ set animation frame to 1

    else/ set animation frame to 0

    result: keyPress does not change the button - mouse does

  • Awesome! It works perfectly that way. Thank you for your input. I am still trying to understand how C2 code works compare to JavaScript.

    Corrected code:

  • Well I think it must be coming from another problem because I still have the issue with a mouse event instead of a touch event.

    Thanks for the example, BTW!

  • Oh OK. I get it. So I guess I should use mouse instead of touch for this to work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • when using the code below, the trail button works when pressing T but not when clicking on the button. Why?

    frame 1

    frame 2

    Note: Animation is set to speed 0

  • The family did not work but fantastic, your system works.

    Man, this has driven me crazy for a while!

    I think the else for each object just messed things up and thinking about it now, it makes sense.

    You made my day!

  • Thank you for taking the time to answer my question.

    Mouse does not work and I think it is the else that is interfering with the rest. Let me try your idea and I will get back with you either way.

  • Thank Allan. I decided to not use the tabIndex since it interferes with the other elements on a web page which also are getting focus on tab.

  • Somoeone posted a work around - put the music file in the sound folder and they will loop. when in Music folder they stream only and do not loop. probably an HTML5 issue.

    By the wat Mercuryus, on local it loop and on server it does not loop unless the files are imported in the sound folder instead of the music folder.

  • I have a page with several buttons for a menu as well as a music button and a reset button.

    For each of these I have the following code:

    Mouse/cursor is over "object name here" /mouse/set cursor to Hand

    System/else/Mouse/set cursor to normal

    "object name here" - here of course I have the name of the element I want the cursor to show the hand on mouse over.

    I also tried to use a family with the same code but it still does not work right:

    The menu buttons get the hand cursor on mouse over

    The Music and Reset buttons do not.

    Why?

  • I also have the same question. I need my users to be able to navigate using tab and I would like this to be implemented so I can compare an instance ID with the tabIndex to activate an event.

  • Can anyone tell me why when going from one layout to another, setting a layer to invisible does not work.

    Here is the set up:

    layout story - has several layers. one is called "intro" on is called HUD

    layout review

    the story layout has some animations and events going on. At the end we click to go to review layout.

    I get a menu slide in by clicking a button from HUD.

    This menu has several buttons. Each one send you back to the layout 'story' but now I want the layer intro not showing and be deactivated.

    I tried the code on the review layout event sheet and i tried the code in story layout event sheet since it is HUD global variable I think it does not make any difference.

    The code on HUD buttons is:

    gotolayout story

    hide layer intro

    deactivate intro group

    set player x position to 300

    Unfortunately it goes to layout Intro but does not hide the layer intro.

  • Now that I looked into this music problem, since the music is streaming when put in the music folder, would it be correct to use:

    audio | on tag "bgMusic" ended ||  audio | play music looping at volume 0 db (tag "bgMusic")[/code:wwukk4tc]
    
    I think it might mimik the javascript equivalent:
    
    [code:wwukk4tc]
    myAudio = new Audio('someSound.ogg'); 
    myAudio.addEventListener('ended', function() {
        this.currentTime = 0;
        this.play();
    }, false);
    myAudio.play();
    
    [/code:wwukk4tc]
  • Spacedoubt, you saved my day!

    It is not a Chrome issue only since the same happens in FF and Edge. But putting the music files in the sound folder does correct the not looping issue.

    I make several educational games a week and just started to use C2 and this was a major issue because we are following department of education guidelines and we need the music background to loop!

    THANK YOU!!!!