You must be logged in to post

 
Search Forums:


 




to show text?

UserPost

1:44 am
Dec 28, 08


liverol

Member

posts 9

1

hi there,testing flow3d for a while,

just a question:how can i show a single line text?(like showing fps on screen)

should i use CEgui gadget? 

by the way,just curious if flow will support unicode?(cegui can do this,but i think you didn't implement it now),customers from asia can use to show their local text! hope we can see this in the later version!

happy coding!

4:45 pm
Dec 28, 08


damiensturdy

Moderator

posts 84

2

You would use an Overlay file. I'll get an example of this as soon as I get 5 minutes. :-)

Cheers and Beers, Damien Sturdy, Resident Blitz-Maxer.

3:25 pm
Dec 30, 08


damiensturdy

Moderator

posts 84

3

Update on this- my PC's misbehaving a fair bit and I can't compile any Max code at the moment, I'm reinstalling my OS shortly so should be back up an running and able to provide this demo shortly.

Cheers and Beers, Damien Sturdy, Resident Blitz-Maxer.

10:34 pm
Dec 30, 08


Adriantmax

Moderator

posts 56

4

You can use CEGUI. Damien got a quick Overlay example put together today. It will let you print 2D text to the screen without CEGUI.

Overlayexamples.zip

Hope that helps.

10:09 am
Jan 01, 09


Foolish

Member

posts 15

5

Helped me. Thanks.

3:02 pm
Jan 02, 09


Admin

Admin

posts 56

6

Glad we could help. I need to put a page up on the wiki about GUI editors which make CEGUI and overlays much nicer to work with.

Don't know if it's of any interest but there are several usefull GUI related tools, the CEGUI ones improved a lot recently, plus there's a bitmap font tool for ogre which also has CEGUI support.

http://www.robagar.com/software/ogre-bitmap-font-maker.php

The default output is basic white on transparent BG in png format so you need to use some kind of image editor to make fancy looking game fonts. Still a very handy tool :)

11:30 am
Jan 06, 09


Lina

Admin

posts 114

7

Hello again Liverol and Foolish! :-)

I just thought I would chime in with something I am currently working on:

Drawing text to the screen was somewhat of an omission by myself - I just completely forgot that we need a simple helper for drawing to the screen. With the overlay implementation nearing completion, I plan on adding an fG.print or fG.drawText style method that works similarly to the DrawText that Blitz users are used to. :-) This way you do not have to fudge with overlay code for debug output, etc, in the future.

I hope this was of some interest, I will post on my blog when I get a few new helpers finished. :-)

Lina

11:24 am
Jul 07, 09


DiabloV

Member

posts 37

8

Overlayexamples.zip    is dead…


ca anyone help me how to draw a test on the screen ?


thanks…

Q6600@3ghz 8GO DDRII @ Maximus II GENE ATI 5770 1go 2*150GO Velociraptors @ Areca 1210 RAID 0 - 24″ Samsung LCD- 7 64 - BMAX 1.36 & Flow3d

10:59 pm
Jul 07, 09


jwurmz

Member

posts 34

9

Here's a way to display text using CEGUI (hacked up from one of the other examples): one way of displaying text.

12:18 pm
Jul 08, 09


Lina

Admin

posts 114

10

Hello again DiabloV! :-)

The easiest way to do this would be to create an overlay script and then set the caption of a text area in code. Here is how to do this:

1. In /media/2D Overlays there should be a SingleOverlay.overlay file. This overlay describes a single text area and should be usable for your purposes.

2. You can use code like this to set the caption in the text area of SingleOverlay.overlay:


Import flow.Main
EnablePolledInput()
fG.init()

'Get the overlay specified in the script, then get the main panel it uses.
Global HUD:TOverlay = TOverlayManager.getByName(”SingleOverlay”)
Global HUDMainPanel:TOverlayContainer = HUD.GetChild(”SingleOverlayPanel”)
Global Line1:TOverlayElement = HudMainPanel.GetChild(”SingleTextArea”)

'Make the entire HUD visible.
HUD.show()

'Main Loop
Repeat

    'Display 2 test lines
    Line1.setCaption(”Test Line 1~nTest Line 2″)

    fG.renderWorld()
    Delay 16.6666667
   
Until KeyDown(KEY_ESCAPE) Or fG.AppTerminated()


In the future there will be text drawing helpers built into fG, but right now this is the easiest way to handle drawing text to the screen.

I hope this helps! :-)

11:18 pm
Jul 08, 09


DiabloV

Member

posts 37

11

ok this work (but is incredibbly complicated to draw a simple text !) 

i hpe the new update coms quickly with the intégrated text xommand such as irrlicht commands per ex.   ;)


PROBLEM :


i want to create my own text overlay BUT this make mi an error en exit the programm.

Global HUD:TOverlay = TOverlayManager.getByName(”momotext”)
Global HUDMainPanel:TOverlayContainer = HUD.GetChild(”SingleOverlayPanel”)
Global Line1:TOverlayElement = HudMainPanel.GetChild(”SingleTextArea”)

as momotext  is a new file called momotext.overlay


any idea ?


thanks

Q6600@3ghz 8GO DDRII @ Maximus II GENE ATI 5770 1go 2*150GO Velociraptors @ Areca 1210 RAID 0 - 24″ Samsung LCD- 7 64 - BMAX 1.36 & Flow3d

3:44 pm
Jul 16, 09


Lina

Admin

posts 114

12

Hello again DiabloV!

Yes, I understand that the current method for drawing Text is a bit complicated. I plan to add a simple function for drawing text in the next maintenance release (1.075) in the coming weeks to make this easier. :-)

As for your problem, in order to answer your question, I will need to see the contents of momotext.overlay in order to diagnose the issue. If you can get back to me with that information, I'd be happy to help!

Have a good evening!

Lina

11:19 pm
Jan 12, 10


DiabloV

Member

posts 37

13

Just tested, works fine.


thanks !


Smile

Q6600@3ghz 8GO DDRII @ Maximus II GENE ATI 5770 1go 2*150GO Velociraptors @ Areca 1210 RAID 0 - 24″ Samsung LCD- 7 64 - BMAX 1.36 & Flow3d


 


Looking for something?

Use the form below to search the site: