Nilom's Recent Forum Activity

  • Hello!

    Is it possible to add objects to families from within events?

    I'm trying to create sliding menus. Like for selecting your birth date etc. .

    And I found dop2000's example here: https://www.construct.net/en/forum/construct-2/how-do-i-18/swipeslide-transition-menu-132684. He uses a family for the button movement. But for creating the buttons I use a function and it would be great if I could assign these inside the function to the right family.

    Or alternatively does somebody know other ways to achieve this?

    Basically what I'm trying to do is exactly this:

  • Thank you for both of your suggestions. I'm sure these will come in handy in the future. For now I will just use separate text objects for regular text and for button text.

    Stupid me was too fast with posting before thinking. But now I know two alternative solutions for future problems. :D

  • Just trying to delete all text with the exception of button text. But I guess I will just use other text objects for button text then. Might also have better performance than checking collisions etc. .

  • Try Construct 3

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

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

    I use 9patch objects for my buttons. How can I check the collision between text objects and 9patch objects as both do not have "on collision with another object"-events?

  • Okay I see the problem now. It is way more complicated than I thought. The same goes for italic font. Some letters will be cut off at the end.

    So I guess it is never a good idea to set the text objects size exactly to the text size.

    Perhaps instead of guessing I could use some sort of percentage "buffer zone" around the text. That way it would be scalable.

    For now I will use something like

    Text: Set size to (Self.TextWidth+Self.TextWidth÷10, Self.TextHeight+Self.TextHeight÷10)

    which will make the actual size 10% larger.

    Thanks Ashley for the explanation!

  • I was facing the same problem.

    What did the trick for me was to place a TextInput object in the editors layout and to untick "Auto font size". You can place it off-screen and delete it on startup. The following TextInput objects that you spawn will keep the settings.

  • Thank you so much for your time and efforts!

    Okay I will do that. Is there a way how I can disable BBcode from within the events? I didn't find it yet.

    Edit: For now I achieved this by placing a Text object in the editor on the layer with BBcode disabled which gets destroyed on startup.

    And it works! Awesome. :D

  • It's basically just the part in the second picture. But I uploaded a dumbed down version of the project where the issue still persists.

    drive.google.com/file/d/1tu3wghFCFtbmjTKpAjwt4I-Q2WwG8gL7/view

  • Ahh. Good to know. But how comes that letters like g j q y get cut in the bottom part when I set the Text objects size to "Text.TextWidth, Text.TextHeight"?

    I know I could just put Text.TextHeight+20 or something like that but I wanted to have a scalable system.

  • Thank you that's a good idea to pre-place a hidden text object. I will test that out.

  • Hello!

    I have issues getting the correct text height.

    The result is that letters like g, j, q, y are cut and that the text is not centered correctly inside the buttons.

    Is it true that the height of letters like g, j, q, y, which pass the imaginary bottom y-line of the letters (red line), are not correctly calculated? It seems to me that Text.TextHeight is only calculated from that imaginary line to the top (red arrows).

    It's a bit hard to describe what I mean so I tried to skatch it. How can I calculate the pixel height between the violet arrows?

    This is the function that I'm using to create buttons.

  • Hello.

    I have two questions about good Construct 3 practices.

    Question 1:

    If the app that I'm creating has a sign-in system and account creation etc., or let's say some sort of complexity, is it better to have these systems on separate Layout- and Event Sheet Pages? And let's say after signing in move to another Layout to have less code in the "Event loop" or doesn't it matter too much? (I do not use any handpositioned objects in the layouts.)

    Question 2:

    Is it better for the performance/workflow to use variables to toggle parts of the Event Sheet or to just put said parts in groups and activate and deactivate them as needed? In the example above that could be the sign in or account creation processes.

    Thank you in advance.

Nilom's avatar

Nilom

Member since 26 Dec, 2019

Twitter
Nilom has 1 followers

Trophy Case

  • 4-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

9/44
How to earn trophies