Results 1 to 3 of 3

Thread: cl_textedit, menu, main loop (some problems i have) [2.3.4]

  1. #1

    Default cl_textedit, menu, main loop (some problems i have) [2.3.4]

    i'm new to clanlib and not that experienced in c++. although i worked with jframe from java.
    so i'm trying to create a game (as a project for university) and i have a couple of problems regarding the clanlib.

    1. how do i use cl_textedit? there are 2 players and i want to display their name in 2 textfields.
    i adjust the value every second. i cant even initialize it, because i dont know, where to get (CL_GUIComponent *parent) from.
    so a little help on how to use it would be nice.

    btw: can i also use a w w for text input? i need a textfield so the user can enter the server ip and his username

    2. is there a way to design a proper menu? right now i'm using enum/chars and
    CL_Font_System font;
    for every single text on the screen.

    3. i got different draw methods for game and menu. and in the mainloop i choose the right one using a char (g = game, m = menu)
    at the beginning of run() i set selected='m' but the game starts immediately.
    if in the main() i put a sleep(1sec) after all the setup stuff (setupCore, setupDisplay/GL/Network) and before creating the object containing run() with the main loop,
    the menu is shown properly. do i have to wait for the setups to finish? if yes, how do i check if they're done?

    4. is the method to swich screen contents as described in 3. bad coded and how can i do better?

  2. #2
    ClanLib Developer
    Join Date
    May 2007


    I haven't got time to answer in depth, but have a look at how "Examples/Game/Dicewar" is structured. It was created a couple of years ago by a ClanLib developer that has had lots of experience.

    I am not familiar with its source code, but it might assist you.

  3. #3


    i got some help in the irc so now question 1 and 3 are still open...

Similar Threads

  1. CL 2.3 : CL_TextEdit bug & CL_Tab callback
    By Zenol in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 12-12-2012, 07:57 AM
  2. CL_TextEdit
    By Jason Schilling in forum Official ClanLib SDK Forums
    Replies: 7
    Last Post: 08-13-2012, 02:41 AM
  3. how to while(device->run()) loop in irrlicht?
    By blackMasoon in forum Proton SDK
    Replies: 5
    Last Post: 08-07-2011, 11:07 AM
  4. Main loop - best practice
    By spin in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 01-08-2011, 09:31 AM
  5. GUI menu redraw & dropshadow problems with dualhead setup
    By Harry in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 01-10-2010, 09:28 AM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts