netdzynr's Recent Forum Activity

  • Didn't know about that behavior, thanks for the suggestion!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I have a string like: 1,1,2,3,3,3,4,5,5

    How do I retrieve only unique numbers (or remove duplicates) from the string?

    The desired result would be: 1,2,3,4,5

  • "Situation" may be a poor word choice -- each mouse click event is taking place on separate controls and objects in a UI. Some of the controls trigger events, some of the controls trigger events but also trigger other controls, and some of the clicks occur on non-control objects in a layout.

    It's becoming increasingly difficult and messy to try to route all these events through a single mouse event handler, which is why I want to employ multiple mouse event handlers, unless there's some penalty/disadvantage for doing so.

  • I'm wondering if there's any benefit/efficiency to be had when using one central mouse-handling event, versus having separate mouse handlers for explicit events, controls, etc.

    In other words, is this...

    on mouseclick

    test for situation 1

    do something

    test for situation 2

    do something

    test for situation 3

    do something

    ...any better/more efficient than

    on mouseclick & situation 1

    do something

    on mouseclick & situation 2

    do something

    on mouseclick & situation 3

    do something

    I currently have a project set up using the former arrangement (one central mouse event handler) and it's becoming increasingly unwieldy and difficult to manage the code. So can I consider breaking up the handler into separate individual mouse events, or would it be bad to have, say, 20 separate mouseclick events all tracking the mouse at the same time?

    Thanks in advance for any enlightenment here.

    Tagged:

  • Is it possible to export (and later re-import) the objects of a single layer?

    I'm looking to save various object arrangements into external files, and then read any of the saved files back in and create/arrange objects accordingly.

    Is there a way to use Construct's existing JSON structure for this, or would I need to loop through layer objects and build my own lists?

    Tagged:

  • Thanks for the response. In answer to your question, I used the term "canvas" to describe the result I was after, but I get that's also an object type.

    I've implemented several of the suggestions you offered, though I wasn't able to get scrolling to work without using absolute X/Y coordinates. Regardless, the behavior seems to work fine.

    FYI, the project I'm building is essentially a browser-based web app, so I'm trying to keep the display of content at full scale, regardless of browser window dimensions. Turning off full screen mode seems to accomplish this.

    Thanks again.

  • I'm trying to set up what would essentially be an infinite canvas that can be drag-scrolled in any direction without end. Of course, this can have practical limits if needed, but the goal is to make something similar to a canvas layout area similar to Figma or Sketch.

    I'm looking to create these features:

    - (near) unlimited space

    - canvas fills screen when browser is resized

    - user controls stay fixed at edge of browser window during resize

    I put together a model which seems to do the above, but I'm wondering if some kind soul can take a look and see if there are better ways to set this kind of thing up in Construct.

    https://www.dropbox.com/s/jdqhjfstqod1nay/Infin8%20Canvas.c3p?dl=0

    For one thing, the controls bounce and jiggle when the browser window is resized, which I can live with, but is there a better method for anchoring the controls and/or handling the resize of the browser? The bottom label doesn't seem to stay anchored properly?

    Is it reasonable to start with a layout that's 20,000 px square or even larger? Can a layout be dynamically resized if needed?

    Also, I enabled unbounded scrolling for the main layout, but when scrolling to the 0,0 (left/top) origin, the viewport seems to reach a limit when it can't scroll any more. Again, if the layout is large enough to begin with, this limit is not a huge deal, I just don't know if this is the best way to set things up.

    Thanks for looking.

  • Thanks. Appropriately, the sample code is yours 😉

  • I see this in a demo file I've been reviewing, which is setting the value of a variable. Is this an if/then/else statement?

    b1 >= 0 ? (b1 - b1%50) : (b1 - b1%50) -50

    Tagged:

  • A quick update to this thread...

    Currently, creating the arrows as hierarchies seems to work well. They can be positioned in layout view as single objects (same as containers set to "select all"), they can be resized while maintaining their isometric perspective, and they can be moved as single objects at runtime without any laborious pinning required.

    So far so good, hoping I don't run into any additional issues. 🤞

  • Thanks again for your suggestions on this.

    I would happy to use regular sprites, but the arrows are skewed to isometric angles and need to resizable, set to any random size in the layout, which is why the arrow bodies are made using 9-patch and tiled background objects (the arrowheads need to stay at fixed dimensions). AFAIK, there's no way to stretch a sprite (besides a simple line) along one axis without distorting it, is there?

    The use of containers makes it easier to treat each arrow as a single object in the layout. Sure, I could manage all the resizing/aligning behavior in code at runtime, but that means I'd have to build an entire editing system that saves and reads in all the arrow/object sizes and positions from external files, a fairly non-trivial amount of work.

    Anyway, I was also looking at using scene graphs as an option, so I guess I'll give that a try.

    Thanks again.

  • Thanks for the response. To explain more, I have a dozen containers that each contain 2 objects -- they're essentially stretchable arrows with a shaft and an arrowhead. Multiple instances of these containers appear throughout the layout, and I can't figure out how to iterate through the containers to pin each set of contained objects. AFAICT I can't simply reference an object type or name because multiple instances of those objects exist in the layout.

    The way I see it, I need to somehow determine that an object lives in a container and then pin it to its corresponding object in the same container.

    Or is there another way to approach this?

    EDIT: Adding a link to an example layout:

    dropbox.com/s/21aolu9os7jttxm/arrow_test.c3p

netdzynr's avatar

netdzynr

Member since 17 Dec, 2017

None one is following netdzynr yet!

Trophy Case

  • 7-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies