Mylon's Recent Forum Activity

  • I'm making a strategy RPG and UI/mouse is going to be a big part of my project. I need to be able to differentiate between a click, a click+drag, and a double-click. Unfortunately, starting the drag still counts as a click and any slight mouse movement during the click-release counts as a drag.

    I tried using "on any click set mousestartx , mousestarty to mouse.absolutex,mouse.absolutey" on one event with another for "while dragging" + "if 30 <= distance(mousestart,mouseend)" to prevent clicks from starting the drag event but it seems this condition is only checked once and then ignored because it's not true when it started.

    I can probably edit the javascript on publication to change the mouse-click to mouse-release. But I still need to prevent the drag behavior from firing too easily.

  • Is "On Browser Close" a feature added betwee 206 and 210? I don't see it on 206.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    Trying to mix progress bars and a custom mouse cursor can result in the mouse cursor changing when hovering over the progress bar, leading to a potentially disruptive experience.

    On IE 11, the event seems to fail entirely and there is no custom mouse cursor.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/552 ... gDemo.capx

    Description of Capx

    CapX uses a mouse with a cursor from sprite and contains a progress bar for the user to mouseover.

    Steps to Reproduce Bug

    • Set the mouse cursor to a sprite
    • Add a progress bar
    • Run the project via preview
    • Move the custom mouse cursor over the progress bar.

    Observed Result

    Mouse cursor reverts to windows mouse cursor while over the progress bar.

    IE 11: No custom mouse cursor happens at all.

    Expected Result

    Mouse cursor retains the sprite while over the progress bar.

    IE 11: Mouse cursor takes on the sprite's appearance.

    Affected Browsers

    • Chrome: YES
    • FireFox: UNTESTED
    • Internet Explorer 11: YES

    Operating System and Service Pack

    Win 7 SP1

    Construct 2 Version ID

    206

  • OnSuspend is for when the user alt-tabs. It might be called when they close, but it will also be called very frequently.

  • I'm making an idle game. A typical feature of these games is that you can close them at any time and progress will be saved. How do I get this behavior? "on end of layout" event is not when the window is closed, making this an unsuitable trigger.

  • Alright, so my "set css value "color" to ""rgb(" & int(255 * (1-(Heroes.HealthCurr/Heroes.HealthMax))) & "," & int(255 * (Heroes.HealthCurr/Heroes.HealthMax)) & ", 0)"" code works in Internet Explorer to change the color of the progress bar based on it's current progress, but this doesn't work in Chrome (because of the use of #HealthBar::-webkit-progress-value makes it more difficult to get in there and dynamically change the style.

    Is there away to reference the property or am I going to need to edit the progressbar plugin?

    Edit: There doesn't seem to be a way to change the ID of an object. Even if I define 4 possible styles for my progressbar, I have no way of changing the ID to take advantage of those styles.

  • Noncentz705: That link gave me the info I needed, thanks.

    this is how my CSS looks:

    #HealthBar {
        background: #333;
        color: #0f0;
        border-radius: 6px;
        height: 24px;
        width: 65px;
        padding: 2px;
    }
    
    #HealthBar[value]::-webkit-progress-value {
        background: #0f0;
        border-radius: 6px;
        width: value
    }
    
    #HealthBar[value]::-webkit-progress-bar {
        background: #333;
        border-radius: 6px;
    }[/code:2dkw10qy]
    
    And that gives me the rounded edges and the desired color.
    
    Thank you so much for your help with this, by the way.  I'm learning a lot about CSS.
    
    Now the question is, how would I edit "#HealthBar[value]::-webkit-progress-value" element to change color using the event system.  I would like it to fade from green to red as health drops (akin to something like ""rgb(" & int(255 * (1-(Heroes.HealthCurr/Heroes.HealthMax))) & "," & int(255 * (Heroes.HealthCurr/Heroes.HealthMax)) & ", 0)""
  • Alright, I got the css file loaded in the game! I guess it's important to note that the "set web font" isn't specific to that text element. It allows the css file to be applied universally to the layout.

    But now I'm running into a roadbloack. I can't figure out what the sub-element is called (that is, the portion of progress that is full) so that I can modify the style. Using the code I posted earlier, I get this result: http://imgur.com/L93asUL It seems there may be a third element too, the background of the progress bar itself.

  • Noncentz705, that one requires r209. Maybe you could show off the relevant events with a screenshot?

  • I'm aware of the "set css style" action, but I'm not familiar with what elements are available. For example, this site has some code for a fancy progress bar:

    http://stackoverflow.com/questions/7190 ... ml-and-css

    This is also a good example of something I'd like to do, done slightly differently:

    http://jsfiddle.net/cwZSW/1502/

    Like if I try to do "border-radius" I don't get any affect. If I add background-color of #0f0 and a border, only the border is the expected bright green and not the actual filled portion of the progress bar. Basically, how do I get the results from the link?

  • "pick lowest" only lets me pick instance variables, it won't let me pick by instance properties.

    Edit: Ooops, I goofed on object creation. But the "pick by ordered" then exit loop works.

  • I'm using a hex tile map where the tiles have a height value so I can't just use the tilemap object vanilla style so each row has its own tilemap instance. Well, to operate on this tilemap I'm going to need to need to figure out Y coords by picking specific tilemap objects.

    For example, to make the map bigger, I want to create a row on top of the highest one, but I need the y coords of the highest (lowest y value) instance. How do I pick this instance?

Mylon's avatar

Mylon

Member since 22 Jul, 2013

None one is following Mylon yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies