How do I implement lots of text?

Just started using Construct 2? Post your questions here

Post » Mon Apr 27, 2015 11:01 pm

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!
B
3
Posts: 6
Reputation: 187

Post » Tue Apr 28, 2015 10:09 am

Actually IE allowing you to drag/drop buttons is a fault on IE's part. DOM elements are not supposed to act that way and that's why it doesn't work in FF and Chrome/NW.JS.


So in the end, what are you really looking for ?

A way to add format to the text object ? From the sound of it all you'd need is a background color, right ? Add a Sprite underneath the Text object, possibly use the Pin behavior, you are set.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Tue Apr 28, 2015 5:51 pm

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!
B
3
Posts: 6
Reputation: 187

Post » Tue Apr 28, 2015 8:06 pm

As you may see in the project's properties, C2 pretty much takes care of the high DPI on its own with a "fallback" when HDPI is not available.
Not sure there's a need for you to modify the pixel size of the fonts. If it is readable, it is.

This might go along supporting multiple screen resolutions.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,317
Reputation: 87,483

Post » Sun May 03, 2015 8:08 pm

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!
B
3
Posts: 6
Reputation: 187


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest