NOGDUS $1670.00 has been donated to NOGDUS!
September 20, 2017, 08:30:10 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: StaticText  (Read 3955 times)
0 Members and 1 Guest are viewing this topic.
bedndarc
Offline Offline

Respect: 0
« on: January 27, 2011, 01:39:37 AM »

How properties StaticText are correctly edited?
In what format text color is underlined?
How the font changes?
**
StaticText.SetFont("data//fonts//arial.ttf") - probably it is not true. (Does not work)
StaticText.SetColor(Huh?)

And last, type size.)
Logged
bedndarc
Offline Offline

Respect: 0
« Reply #1 on: February 13, 2011, 11:25:46 AM »

 Sad Sad Sad
Logged
Richard Marks
Administrator
Offline Offline

Respect: 3425
« Reply #2 on: February 18, 2011, 10:30:19 PM »

I'd love to help, but I don't understand at all what you are asking. Undecided
Logged

bedndarc
Offline Offline

Respect: 0
« Reply #3 on: February 19, 2011, 12:59:49 PM »

Problem following: It is impossible to change a text font, I am possible have incorrectly understood an operation principle, here and wanted that someone has explained this question. Well and as a whole, change of properties of the text, doesn't give result.
Logged
Richard Marks
Administrator
Offline Offline

Respect: 3425
« Reply #4 on: February 19, 2011, 02:48:27 PM »

I am not sure how it is meant to work, but after reading the documentation of Pixie, this is what I think you need to do:

First, you need to use the PixieFGT (Pixie Font Generation Tool) program to create a font file that the Pixie Engine can use.

I think you need to use the command line something like this:
Code:
C:\Pixie\PixieFGT.exe fontname fontsize [spacing] [-antialias]

Then, once you have the generated font file, you need to create a Font Resource and have StaticText use that.
I am not sure the syntax, as I do not use Pixie myself.

I think it is something like this:
Code:
Resource_Font myFont("data/fonts/myfont.fnt");

StaticText myText;

myText.SetFont(myFont);

It is my understanding that there is no SetColor method in the StaticText class.
I believe that to change the color of text, you need to change the color of the image you are drawing the text on.

Good luck!
Logged

bedndarc
Offline Offline

Respect: 0
« Reply #5 on: February 20, 2011, 01:30:51 PM »

Thanks, I will try, but all but creation of a resource I fulfilled, is possible in it and the reason is covered.
Logged
Cycl0ne
Guest
« Reply #6 on: April 08, 2011, 06:11:36 AM »

Code:
MyTExt.SetColor(Color);

Is working, since SetColor is taken from the Sprite Class, which is inherited from StaticText.

Cheers.
Logged
Mattias Gustavsson
Moderator
Offline Offline

Respect: 58
« Reply #7 on: April 12, 2011, 12:46:51 PM »

Hi guys - sorry for the delay in answering, things have been a bit busy  Roll Eyes

Richard is right, you need to use PixieFGT, the font generation tool, to create a font (will give you an .XML and a .TGA file, and you can then, if you like, convert those to a .FNT using PixiePCT, the picture conversion tool)

Once you have a font file, you can do
text.SetFont("data/fonts/arial.xml")
or
text.SetFont("data/fonts/arial.fnt")

As Cycl0ne says, you can call SetColor, as StaticText inherits this from Sprite. There's no way to change size - if you want fonts of different sizes, you have to generate them as such.

Hope this helps - if you have any more problems, just ask - and I'll try to be quicker on the reply Cheesy
Logged
bedndarc
Offline Offline

Respect: 0
« Reply #8 on: April 17, 2011, 05:28:23 AM »

ok )))
Logged
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
.: Theme by Richard Marks :.
Valid XHTML 1.0! Valid CSS!