Draw a text over a sprite

Discussion and feedback on Construct 2

Post » Sun Dec 11, 2011 6:15 pm

I need to create a game where I have a lot of bricks with a word on them, but I need to put that word at runtime because this words will be read from a server using PHP. What I need is a sprite on wich I could put a fisic behavior and then draw a text over it. Got it?
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Post » Sun Dec 11, 2011 10:16 pm

You can use the Sprite Font Plugin for this, right?
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Sun Dec 11, 2011 10:28 pm

Sprite font? I dont know this plugin, I will search for it. Thanks.
Edit: This is a Construct Classic plugin, Im using C2.

Vinians2011-12-11 22:31:55
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Post » Sun Dec 11, 2011 10:37 pm

@Vinians: No it's a C2 plugin.VampyricalCurse2011-12-11 22:38:24
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Sun Dec 11, 2011 10:41 pm

[QUOTE=VampyricalCurse] @Vinians: No it's a C2 plugin.[/QUOTE]
Nice plug in friend but its not what Im wanting. What I need is sprite where I can put a text in front of it at run time. Imagine a box with a text in it, I cant create a lot of different sprites with theses text because I will get theses texts from a PHP script and its will change during runtime.
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Post » Sun Dec 11, 2011 10:53 pm

This plugin should be able to get the string you are passing and display it as text though. Or maybe I didn't understand what you are asking. But I think what you want is, to have text displayed over the bricks sprites. This plugin shows text and it should be able to do so over the bricks, no matter where you get the text from.
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Sun Dec 11, 2011 11:08 pm

Do you know the text beforehand? If so, create the texts as sprites and use the pin behaviour to pin the relevant text to the relevant box.
B
72
S
25
G
9
Posts: 382
Reputation: 10,649

Post » Sun Dec 11, 2011 11:16 pm

[QUOTE=Nickydude] Do you know the text beforehand? If so, create the texts as sprites and use the pin behaviour to pin the relevant text to the relevant box.[/QUOTE]
The texts will change but they will be created one for each sprite. I will try this "pin" behavior... Thanks/
Edit: Dont work because I create a this sprites and text at run time...

Vinians2011-12-11 23:18:59
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Post » Mon Dec 12, 2011 12:22 am

Try this
There's only problem that the Text object can't be rotated with the sprite. You'd have to create another sprite instead and place it over.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Mon Dec 12, 2011 2:02 am

[QUOTE=Noga] Try this
There's only problem that the Text object can't be rotated with the sprite. You'd have to create another sprite instead and place it over.[/QUOTE]
Exactly! I just discovered by my self but my solution was same as yours! Thanks a lot!
Obs: We need to request the C2 creator to create something like intercepthig the draw event like an after draw so we can draw anything over it without need to create another object to do the work.
Be nice with others and with yourself!
My musics: https://soundcloud.com/vinians
My C2 Forum:
http://nmbr.forumeiros.com/
My Site:
http://www.dicasebytes.com.br
B
21
S
5
G
6
Posts: 166
Reputation: 4,885

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Tom and 22 guests