AllanR's Forum Posts

  • Awesome! Thanks Ashley!

    A higher-res sprite font scaled down to half size looks much better (sharper) than a smaller sprite font at 100% - at least with small point sizes.

    And then one font can easily do multiple sizes - 50% for small, regular text, 100% for headings, and 150% for titles.

    Although I am eager to try the new web fonts in C3...

  • pcprice76

    There are a bunch of ways to make it do what you want... it depends on how complex your project is. If there is a lot going on, and you want to pause all that and enter a different state, then you would want to put code in different groups and disable groups you don't want running. (that would disable the sprite that creates the m.Glass one, so you don't have to worry about it processing a tap).

    The most simple way is to just make sure the m.Glass sprite is not overlapping the other sprite. I made a quick example of that...

    http://www.rieperts.com/games/forum/Tap.capx

  • rotacak

    99Instances2Go suggestion should work fine, another way would be to add a second condition to the big sprite click that says "mouse not over small spite"

    so:

    IF small sprite is clicked: add score

    IF big sprite is clicked AND mouse not over small sprite: decrease score

    (You do a "not over" condition by adding another condition that says Mouse Over object, and then right-click that and invert it)

  • Problem Description

    When a Spritefont is scaled down (to 0.5 for example), character spacing changes slightly as the text changes. On the same line you often get the same letter spaced differently. I made a line of text with the word "this" repeated several times. Sometimes the i was closer to the h and sometimes it was closer to the s.

    At full scale it works fine. Adjusting character widths only made things worse because there was no way to predict how letters were going to get spaced. Using a smaller spritefont at a scale of 1.0 spaced properly, but was too blurry. The larger spritefont scaled down was much sharper, but inconsistently spaced.

    It looked like a rounding issue to me, so I went digging in the Spritefont plugin and commented out two lines where the x value was being rounded. That seems to have fixed the problem, and now looks just how I was hoping. I know it is a really bad idea to change official plugins, and I don't want to make my own spritefont plugin (and I am not sure this was the best solution).

    The lines I changed are:

    if (angle === 0)
    {
    // roundX = Math.round(roundX);
       roundY = Math.round(roundY);
    }
    [/code:12m67hdp]
    
    in the instanceProto.draw and instanceProto.drawGL functions.
        
    [b]Attach a Capx[/b]
    [url]http://www.rieperts.com/games/forum/spritefont_bug.capx[/url]
        
    [b]Description of Capx[/b]
    the capx has two lines of text - with the same spritefont. One line is at a scale of 1.0, the second at a scale of 0.5
    Then ever 2 seconds a period is inserted at the beginning of each line, to show how the spacing changes for various letters in the scaled line of text. Letters that were closer to one side seem to jump to being closer to the letter on the other side.
    
    [b]Steps to Reproduce Bug[/b]
    [ul]
        [li] set the spritefont scale to less than 1.0[/li][/ul]
        
    [b]Observed Result[/b]
    notice how letters shift as the line changed, and the periods are not evenly spaced either.
        
    [b]Expected Result[/b]
    expect character spacing to be consistent regardless of the scale.
        
    [b]Affected Browsers[/b]
    [ul]
        [li] Chrome: (YES)
        [/li][li] FireFox: (YES)
        [/li][li] Internet Explorer: (not tested)
        [/li][li] Edge: (YES)[/li][/ul]
        
    [b]Operating System and Service Pack[/b]
    Windows 10
        
    [b]Construct 2 Version ID[/b]
    r242
  • pcprice76

    I was dealing with a similar mouse issue last night - I was doing something when the left mouse button was clicked on an object. But I was also doing something while the left button was down in another fuction. Out of curiosity, I put a counter in that button down function, and it was getting called on average 9 times along with the first routine. And that was just a normal short mouse click.

    Things generally happen a lot quicker than you think. I bet C2 thinks your "touch" event happens for quite a few ticks. On the first tick of the touch it creates the m.Glass, then the next tick thinks you are touching the m.Glass. so starts running that code. The 0.01 second delay may not be long enough.

    Another issue I ran into months ago is that a tap on objects that overlap registers as a tap on all of them. So, you need to make a way to disable the first sprite while the m.Glass sprite is visible. Then re-enable it when you destroy the m.Glass one. Making the first sprite invisible will not work - the tap will still be processed for it. you have to disable the events where it processes the tap, or move the sprite off screen, or add conditions that say not to process the tap if the m.Glass sprite is overlapping or visible.

  • Try Construct 3

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

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

    The reason you can't pick the new instance inside the function is that C2 does not complete creating the new instances until the next top level event. (That is why you can outside the function - because it is in a different top level event.

    Inside the function you can continue to access the new instance in sub events, under the one that created it. So, you could add a sub event inside the for loop that says if numberDisplay.display_number=1 then set Text to "A"

    Since you try to pick the instance outside the loop, but before a top level event, C2 has not added the new instance into its internal indexes and can't find it.

  • resdesign

    The Z-order is the Tab index. You can change the controls' z-order as you require, and that sets the tab index,

  • well, that was an entertaining thread

    AndyRevenko

    Thought I would add another example...

    Like gameglaux said (maybe a little poorly), if you don't want the single tap code to execute, you have to add a delay and wait to see if there is going to be a double-tap. After a short delay, if there has not been a double tap, then you can execute the single tap code. The single tap event will always fire, so you have to come up with a method of waiting. The double tap event does fire if there are two quick taps on the sprite.

    I took up gameglaux's challenge and make a capx where you single tap to destroy a sprite, or double tap to make it flash. It took 4 events (plus two to spawn a new sprite to try again).

    http://www.rieperts.com/games/forum/TapDoubleTap.capx

  • AndyRevenko

    You can add another condition to the tap on background to say "Touch is not touching player"

    (you do that by saying "Touch is touching Player" and then Invert that).

  • Zathan

    you probably want to change the set BarMask width event to say: lerp(Self.Width,(100-Water)*150/100,3*dt)

    that reverses it...

  • Execution is suspended when the app is in the background. Not much you can do about that...

    You can have it ask for data when it resumes.

    Ashley responded to someone with a similar issue about multiplayer host shutting down when minimised. He is hoping Google provides a method to keep critical things running, and asked people to add comments to his bug report. The only work-a-round he knew of was to have audio playing - that keeps the app running.

    https://www.scirra.com/forum/viewtopic.php?f=151&t=184285&p=1087072&hilit=suspend+minimized#p1087072

  • I was going to say make sure the other object is not on a layer that can't be moved (like a HUD layer) - I always accidentally put things on the wrong layer...

    But it could also be that the screen has no room to shake where the one object is (close to the layout edge). So, like 99Instances2Go said, if the layout is not set to unbounded, then you have to be far enough away from the edges of the layout for the shake to be able to scroll back and forth. (in other words, the edges of the layout have to be off screen)

  • Most of the time when I get invisible text, it is because the text box is too small. Try making the text box a little bigger (and maybe try changing Wrapping from Word to Character).

    I have also had weird things happen if the layout scale gets zoomed in too far. So that could be an issue.

    If all else fails, use sprite fonts - which may improve performance (some platforms seem to suffer from text boxes).

  • Kazan

    First of all, it is not a bug - and it is not Construct's fault for being inconsistent. This is an open GL shader that takes RGB values as a percentage (0 - 100%) and uses those to modify the image.

    I was able to get much closer to what you want by using the ReplaceColor effect. It takes RGB values (0 - 255) although, if you look at the effect code it then converts the values to a pecentage because that is still what the gl_FragColor function requires. I set the tolerance to 100 and then set the Replace values to 29, 160, 225 and got a blue square that was the same as the original. (I changed the color of Sprite2 to a different color just to make sure it was really doing it). With lower tolerances it was not quite ending up with the same color of blue.

  • Ok, I just tried a new blank, multiplayer template and it does seem to have trouble.

    I remember someone asking about the Scirra signaling server being down a while ago... maybe there is still an issue there.