pirx's Forum Posts

  • dop2000

    Hmm I checked out the plugin but it seems a bit wonky from the comments. Will indeed go with the else statements I think. As to the last one, in fact all of these conditions should be separate; I took the screenshot mid-work and didn't notice they pasted all in one block.

    Ashley

    I agree about a single read from an array; in this case though they all need to run unrelated bits of their own logic with no common denominator to reduce to. Well maybe this is not that common a use case after all...

    newt

    As above the last one should be separate blocks; my bad for a sloppy screenshot. A cool idea about doing a loop with a 'stop loop' though - I'll toy around with it.

    Ok then, thank you for the answers - I'll try out some things.

    I'd still argue some sort of a switch functionality would come in useful.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, a situation such as below is quite common.

    E.g. simply choosing a block depending on the value of a variable. Doing it like that is kind of a bad/inelegant practice from logic perspective (because it always checks all the conditions and also doesn't make sure only one block is triggered), so is the only alternative doing a if-else pyramid of doom here?

    (and if so, will C3 ever get a switch statement?)

  • Sounds like it could be easily done with css as opposed to bbcode. Or maybe both together if css can specify bbcode identifiers, I haven't tried.

    That would be awesome, although unless I'm terribly wrong, the Text object does not support css?

  • Is it possible? Making stroke text or outline with color is easy but I haven't found a way to provide the outline width.

    Also: are there any plans to expand the bbcode functionality? (there are some unsupported tags e.g. dropshadow, bigstroke etc.)

  • Yes I thought the doc wasn't saying everything. So it's the order of creation that matters.

    Whereas this makes sense when copy-pasting multiple instances of the container; it is also rather inflexible, i.e. not controllable after the fact (no way to assign a predefined child to an arbitrary instance when a bunch of them have already been created).

    So in the end it would seem it's best to just create/position in runtime.

    Thanks!

  • This one still baffles me somewhat.

    If I place multiple instances of Sprite1 (container) in the layout at random locations, and then multiple instances of Sprite2 (included in the container), how will the editor decide which 2 should belong to which 1?

    Or will it delete all 2's and spawn new ones at 1's centers?

    And also, if the latter is true, then does all positioning with multiple instances need to be done via events, or can I make sure specific 2's belong to specific 1's using only the layout editor (so that it doesn't create new ones at center points but keeps existing ones where they are)?

  • I built a couple of games with online login/accounts and if you don't have much experience with this prepare yourself for some significant headache.

    Fortunately the backend-as-a-service solutions normally handle various aspects of authentication security for you.

    Yes there are multiple services (playfab, firebase); the easiest I found is Parse Server that you can deploy e.g. on back4app - but easiest by no means means easy. You'd have to interface with it using C3's JavaScript code.

    That said, for a recent project (not in C3 though) I got tired of managing user logic and rolled back to Apple Game Center/Google Play for leaderboards etc; and local storage for any data. Way simpler and more manageable. Additionally if you plan on releasing to the Appstore you need to account for other stuff, like app rejection based on required login.

    All in all I'd stay clear of this unless really needed.

  • AllanR

    My touch sprite tracker does have a boolean called StopClick just for rare cases like you mentioned...

    Interesting, but that you said 'rare cases' makes me wonder if I conveyed my point right... so generally I was referring to probably some 95% (99%?) of cases where all you want is tap the specific frontmost object and nothing else. So you'd just slap the StopTouch behavior onto the popup background sprite and therefore need literally zero logic/events/variables to make sure it works as expected.

    So convenient, but as said maybe that'd be technically problematic. Also I'm no longer sure, perhaps it's somehow more versatile or better the way it is for the majority of users.

  • newt

    Minification doesn't touch the developers strings, that's why its a security concern.

    Right! So that would explain what Ashley said about how allowing name retrieval would make projects easier to reverse engineer.

  • AllanR, thanks, very clever. Actually I love how much control this solution gives you. It also avoids the clutter of variables and irrelevant event groups just to prevent accidental clicks.

    I was thinking of simplifying it a bit by retrieving the name of the Sprite for identification (vs having a variable), but I think Ashley once explained how this is not possible for security reasons.

    I will still say that it would be nice to have some sort of a 'stop touch' behavior or the possibility of adding multiple Touch objects (so that different things are handled by different Touch - then enable/disable accordingly). Instant solution.

    Unless these are also problematic; e.g. having something to do with C3's renderer working bottom to top.

  • Ashley

    Thank you for the explanation - makes sense.

    Come to think of it, I said lots of programs easily have blurs and soft shadows but most of them don't need to do it live.

    Well then, looking forward to this being possible one day. For now looking at the bright side, performance will thank us for being forced to pre-render.

  • For some reason, contrary to multiple other frameworks, Construct has always enforced touch/click propagation to lower layers, meaning clicking something will also click everything below it.

    This is a hassle with popup messages, settings windows and basically anything that appears over the play area.

    I already suggested adding a "Stop Touch" behaviour a couple of times so that the clicked object doesn't let through the event any further, but since there's no such a thing it requires control variables or switching groups on and off and other workarounds.

    Unless 1. There's some sort of a nice feature I don't know about. 2. Someone has a brilliant idea/workaround/hack on how to handle it?

  • this is what I do for UI element shadows - use a seamless 9patch shadow png (so it can be scaled to any width/height without distortion).

    since it is pre-rendered, there is no blur performance hit. Obviously this only works with rectangular objects. This demo creates 10 random shapes with a shadow - the shadow has a fixed offset but the opacity is random. The objects have drag and drop so you can move them around...

    In the top left corner I included a white version of the shadow png so that it can be coloured, but I normally only use black shadows.

    https://www.rieperts.com/games/forum/DropShadow.c3p

    Brilliant!! For this specific project I need some irregular shapes so still need to do the blur stacking thing; but in general surely going to utilize this technique for some popups and other ui elements. Thanks!!

  • kindeyegames.itch.io/effects-for-construct

    Shadow offset.

    Don't know why but blurs are exceptionally expensive, process speaking that is.

    Thanks. Looks like it has everything apart from the blur though... Yes I think the reason is live uniform blurs are somehow too intensive to handle casually. I'm still surprised that there seems not to be a single working solution.

    Found on the forum that an approximation of a good looking blur can be achieved by stacking 4 directional blurs (2xV + 2xH), which indeed doesn't look bad. However not sure about performance implications of doing four blur passes of any kind. Will need to test on mobile.

  • construct.net/en/make-games/addons/255/dropshadow

    This is an effect, but maybe not what you want.. not offset.

    I guess someone could quite easily re-write this to be an offset instead of this

    Thanks. I already have and use this here and there but this is more of a perspective shadow with very limited blur. I meant more like the simplest drop shadow effect that any graphics related software has, also CSS, Unity, Powerpoint, MS Paint ... (well not really MS Paint)