lf0jn's Forum Posts

  • 6 posts
  • No, I have 600 instances of one button (in differant layouts). But every instance of a button has a differant text set to it (within the properties). I have added an instance variable to the object and now I have to set the instance variable manuelly (for every instance) to the text property.

    So every instance of the object exists in a layout and is not generated by code. If I could set the new instance variable to the text property, I could do that with the text object as well. The text objects (its instances) are generated by code and replace the button object or rather the instances of the button.

  • Try Construct 3

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

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

    I know that button.text is not available. That was the first thing that I had in mind. Since it is not available, I have made this post.

    Thank you for your workaround idea. I have thought about it as well and will start implementing it. But I have around 600 buttons (very long story…). Therefore I am still open for alternatives.

  • Hello,

    I want to replace different objects in C2 with code. It works perfectly but I do not know how to get the text of a button in order to set the text of a text object.

    Imagine a button which text is set to test. Now I want to set the text of the text object to test as well (via code).

    Like textobject set text = button.text or something like that.

    Is that possible?

    Thanks for any ideas!

  • Well, on high DPI displays the text is readable but too small. Is there something like the following?

    If highDPIdisplay

    font-size = 20

    else

    font-size = 14

    I have checked multiple ways but nothing worked.

    Do you have any idea?

    Thanks again!

  • Hello Kyatric,

    Thank you for your DOM explanation. I had hoped for a problem on FF`s side.

    I was indeed looking for a way to add a background-color to text objects. Your sprite idea works very well! Thank you very much! It will take quite some time to change the layouts and code, but it will work!

    Probably you can help me with another problem, since you are obviously very experienced in C2.

    How do I handle high DPI displays and “normal” displays in an efficient way?

    Since one can only use pt as font size (text objects), I am really struggling to handle both variations. Is there something like the following?

    If highDPIdisplay

    font-size = 20

    else

    font-size = 14

    Or is there a better way of implementing high DPI displays?

    Again: Thank you very much for your help!

    Regards!

  • Hello fellow constructors!

    Recently I have started my first project with Construct 2. It involves quite a lot of text. Since a text field (not a text box) cannot be styled using CSS, I have chosen buttons in order to display text (fill in the blank text).

    These buttons are disabled and use drag and drop. The Internet Explorer handles this very well but within Firefox and exported exe files (via NW.js) the buttons cannot be dragged.

    Example:

    Sentence start blank sentence end.

    ("Sentence start" and "sentence end" are text fields.)

    The text which is supposed to be dragged into the blank is written on buttons which are styled with CSS in order to have a background color.

    Does anyone know a workaround for this? Or does anyone know a really good way to implement a lot of text (fill in the blank text) with C2? I tried sprite fonts but I am not satisfied with the results.

    Any ideas are highly appreciated!

    Thanks!

  • 6 posts