Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to change the color of one text only?

Author
Message
vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 29th Jan 2012 21:20
Hey guys, i got several dbText's around my game, but they are all white...

Im looking for a way to make one yellow and other red at same time...
If i use dbInk it changes all things to one color.. :S

Any suggestions?

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 29th Jan 2012 23:40 Edited at: 30th Jan 2012 00:05
How about something like this.

WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 30th Jan 2012 01:08 Edited at: 30th Jan 2012 01:10
Better yet, write your own text functions.

vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 30th Jan 2012 14:37 Edited at: 30th Jan 2012 14:42
So for this one:



At DWORD fgColor i put something like RGB(255, 0, 255)?

If yes thanks a lot

@EDIT
I used this:





It gave me errors:

Quote: "
1>.\Main.cpp(28) : error C2065: 'g_pGlob' : undeclared identifier
1>.\Main.cpp(28) : error C2227: left of '->dwForeColor' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>.\Main.cpp(30) : error C2065: 'g_pGlob' : undeclared identifier
1>.\Main.cpp(30) : error C2227: left of '->dwForeColor' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>.\Main.cpp(34) : error C2065: 'g_pGlob' : undeclared identifier
1>.\Main.cpp(34) : error C2227: left of '->dwForeColor' must point to class/struct/union/generic type
1> type is ''unknown-type''"


C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 30th Jan 2012 14:52
Did you #include "globstruct.h" ?

The fastest code is the code never written.
vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 30th Jan 2012 16:06
nOW I did, no errors, but no text :S

PS: I got a dbCLS(90,90,90) code :S

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 30th Jan 2012 20:01
Show your code.

The fastest code is the code never written.
vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 30th Jan 2012 20:20
all of it? it has 1400 lines.

Here you have the output function:



And i use it on SystemUpdate



If you want the code:


1500 LINES:


C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 31st Jan 2012 00:00
You are calling SystemUppnge(); twice in your GameState 2. Have you tried NOT using dbCLS()? That is a lot of lines to look at
This updated section might work. Rem out your old case 2: and try this.

Also, be careful you are not calling dbSync() more than once in your loop. That would cause any text you show at one point to not show at the other.

The fastest code is the code never written.
vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 31st Jan 2012 18:47
Wow thanks for that leak there

But still no text :S


PS: You may think: "WTF is Uppnge?"
Well, i was testing another file extensions to my images and i tried dat (UpDATe) And then i used the replace all (dat to png) and... xD

But no text yet :S

i already tried putting in the function a dbInk() before and after the text but doesnt work xD

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 31st Jan 2012 19:45
Post your entire code and I'll pour though it.

The fastest code is the code never written.
vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 31st Jan 2012 20:47
Its after the 1500 LINES: at the previous post

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 31st Jan 2012 21:14
What part is not showing up? Did you get to the start menu?

The fastest code is the code never written.
vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 31st Jan 2012 22:30
yes yes, the OutputText that im trying to show is not showing

its like its commented.. xD

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 31st Jan 2012 22:48
Try calling OutputText using the dbRGB function.

OutputText(350, 100, "HEYOOOO", dbRGB( 255, 255, 255 ) );
Hawkblood
10
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 31st Jan 2012 23:53
That's correct WickedX. That is the problem.

The fastest code is the code never written.
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 1st Feb 2012 01:05
When I wrote this function the RGB macro worked. So I think I have figured out what’s going on here. The RGB macro defined in wingdi.h doesn’t set the alpha transparency. Therefore if text is set to transparent it will not show. If you set text to opaque it will appear, but the macro as defined will reverse the RGB order.
hookkshot
12
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Adelaide, Aus
Posted: 1st Feb 2012 03:41
i use HassinText works great just do a search for it

vitinho444
9
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 1st Feb 2012 12:56
Well -.- im so stupid.. i was thinking i called dbRGB, but instead i just used RGB -.-

Sorry guys!!, Now its working nice

Thanks a lot WickedX and HawkBlood

Can i ask for some names for the credits?

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)

Login to post a reply

Server time is: 2019-12-13 21:10:43
Your offset time is: 2019-12-13 21:10:43