JMKit's Recent Forum Activity

  • Hi, sorry if this has been answered somewhere, I couldn't find it with the searches I put in..

    I'm trying to detect if a dragged sprite is basically being dragged either to the left, right, up or down.

    So as an example imagine a sprite with 5 frames:

    0: dot

    1: right arrow

    2: left arrow

    3: up arrow

    4: down arrow

    If you drag the sprite to the right, I'd want to detect that and tell the sprite to go to frame 1

    alternatively if you drag the sprite up, to go to frame 3 etc.

    Any advice or tips would be greatly appreciated!

  • Is it possible to change the font size for the numbers on the percentage pre-loader, they are very small and hard to read on mobile devices.

    I've made a custom pre-loader but it seems on some devices it still takes a while to actually show the game at all, so the percentage pre-loader helps show somtehing's on it's way.

    Any assistance will be appreciated

  • Thanks for the reply,

    I've never done anything like that but I'll give it a go!

  • what I want to accomplish is have a sprite go to a random animation, between and including "animation1" to "animation7"

    I can use

    Set animation to choose("animation1",animation2",animation3",animation4",animation5",animation6",animation7")

    to get that result, however in my project after completing the game, it will loop back to the first layout, and I'd like to pick out another random animation, but not have the one played first time, play again.

    Is there anything I can add to the code to say, if a variable stating "animation1 has played" is set to 1, don't include that animation in the random list next time it picks?

    I had started writing that out with the "animation1" missing like:

    System "Animation1 = 1"

    Set animation to choose("animation2",animation3",animation4",animation5",animation6",animation7")

    but as it goes on it gets more complicated since any combination of the animations could have played at the next loop of the game.

    Any advice would be appreciated!

  • Great!

    Thanks for the work around, it's working just as the button does combining 'On any touch end' with 'is touching Sprite'

    I appreciate you taking the time to help out with this issue and it's interesting to know what the issue was

  • well it's the simple touch way of opening a link as far as I'm aware, the capx is here:

    http://jmkit.com/newwindowtest.capx

  • And I've noticed I can't place a button over a sprite and make it's initial visibility Invisible or even put it under a sprite so there's no hiding a working button

    *Update*

    So with a bit of faffing adjusting the buttons size (which can vary a lot between devices it seems) and adding CSS styles for transparent background and 0 borders, I was able to 'hide' the button over top of the sprite I wanted to open a link in a new window.

    But I'd love to know if that's something that can be fixed in an update it would make C2 life that much easier for what is a small but (for my current project at least) essential element.

  • Hi thanks for the reply, I'm not sure if that work around changes anything for me though as I've only tried based on user interaction.

    *UPDATE*

    Ok so I created this to eliminate any other code getting in the way and to test a theory:

    http://jmkit.com/linktests/

    if you load up that link on an iOS device you'll see that the 'NEW' button can open up a new window just fine but the sprite 'NEW' trigger does nothing, is this a bug in the way the sprite works as a trigger?

    (the SAME button and sprite open the link in the same window as expected)

  • As per this thread:

    I've also noticed that iOS treats new window requests from construct exported html5 pages as pop-ups, and as it's been stated iOS safari blocks pop ups by default, and even if it wasn't I'd assume the first pop-up someone got they wouldn't have wanted and so disabled them at that point anyway.

    So I want to know is it possible to fix this issue with a construct update?

    Or is there a fix / workaround that we can use right now?

    Thank you for any assistance!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did anyone find a fix or workaround for this?

    Thanks!

  • not sure if u want him to be present on the other sides also...

    Hi I appreciate you delving in to the code to help out, but no that's not what I'm trying to do, if you read my real world example (see my previous post) and watch the video

    Subscribe to Construct videos now

    , i'm just trying to get the outline button to bring him back (even if he's not on that layout) and be able to bring him out again without it duplicating the sprite

    The problem only comes when you click the outline to bring him back (on a layout he wasn't out in) then strait away drag him out again, then he shows up on more than one layout..

    So basically I could get away with having that outline button completely erasing any instance of the sprite and re-creating it, i just can't find away to remove the persistant sprite from a different layout

  • On end of layout set player.x and player.y to two variables called playerPositionX and playerPositionY. On Start of new layout set player.x and player.y to their respective variables.

    Seems like that would always have him on screen though, when what i want is that he's only on (when dragged out) one layout at a time - visualise a dolls house with a box of toys, going from room to room with the box, you place a toy from the box into a room, move to the next room, the toy isn't in that room, or the box... That much I can achieve with what I have right now..

    The difference between digital and real life though is that (and this sounds theoretically possible and is what i'm attempting) to find that toy again in the real world, you'd have to look back through all the rooms, to pick it up and put it back in the box, in digital I'd like to not have to go looking for it, but click the placeholder to have it pop back into the 'box' ready for use again without being duplicated in a weird way lol

JMKit's avatar

JMKit

Early Adopter

Member since 21 Mar, 2015

None one is following JMKit yet!

Connect with JMKit

Trophy Case

  • 9-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies