News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
iGame3D MurgaLua'd
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
iGame3D Background Color Controller UI

I made the UI in Fluid, save to cxx, iGame3D converts it to a lua file and runs it on drag and drop to the application icon.

This UI controls the background color.

Code:
    

--UI roller callback for color values
function color_Rollers()

--retrieve roller values
RedBack=Red_roller:value()
BlueBack=Blue_roller:value()
GreenBack=Green_roller:value()

--set the background color
setSceneInfo(IG3D_BACKGROUND_COLOR, RedBack, BlueBack, GreenBack)

--update labels
Red_roller:label(RedBack)
Blue_roller:label(BlueBack)
Green_roller:label(GreenBack)
end

--a Window with three rollers
  do local object = fltk:Fl_Double_Window(155, 137);
    window = object;
    do BackgroundColor = fltk:Fl_Group(0, 10, 145, 125, "Background Color");
      BackgroundColor:labelsize(9);
      do Red_roller = fltk:Fl_Roller(10, 10, 135, 25);
        Red_roller:type(1);
        Red_roller:labelsize(9);
        Red_roller:callback(color_Rollers);
      end -- Fl_Roller* Red_roller
      do Blue_roller = fltk:Fl_Roller(10, 55, 135, 25);
        Blue_roller:type(1);
        Blue_roller:labelsize(9);
        Blue_roller:callback(color_Rollers);
      end -- Fl_Roller* Blue_roller
      do Green_roller = fltk:Fl_Roller(10, 100, 135, 25);
        Green_roller:type(1);
        Green_roller:labelsize(9);
        Green_roller:callback(color_Rollers);
      end -- Fl_Roller* Green_roller
      Fl_Group:current(Fl_Group:current():parent());
    end -- Fl_Group* BackgroundColor
    Fl_Group:current(Fl_Group:current():parent());
  end

  
--Activate this window
  window:show();
  ig3d_RebuildMacMenubar();

--lets ask tobi for a description of this section
  if game_func==nil then
      function runner()
          fltk_update();
      end
      game_func=runner;
  end

--UI style
  Fl:scheme("plastic")


If we wanted to set the text color interactively we might do something like

Code:
setText_boxInfo(gTextboxes[1], IG3D_COLOR, RedBack, BlueBack, GreenBack,1)


Ok that about covers the very basics. What next?

This post was last modified: 11-26-2007 05:57 AM by iGame3D.

11-26-2007 05:55 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
iGame3D MurgaLua'd - iGame3D - 11-24-2007, 06:54 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 09:36 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 09:53 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 10:13 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 10:50 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 11:21 PM
RE: iGame3D MurgaLua'd - Tobi - 11-25-2007, 04:36 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-25-2007, 05:14 AM
RE: iGame3D MurgaLua'd - Tobi - 11-25-2007, 05:37 AM
RE: iGame3D MurgaLua'd - chrimo - 11-25-2007, 06:16 AM
RE: iGame3D MurgaLua'd - chrimo - 11-25-2007, 06:38 AM
iGame3D Hello World - iGame3D - 11-25-2007, 09:20 AM
iGame3D Background Color Controller UI - iGame3D - 11-26-2007 05:55 AM
RE: iGame3D MurgaLua'd - chrimo - 11-27-2007, 06:01 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 12:26 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 06:04 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 06:32 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 06:36 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 07:11 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 07:29 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 07:43 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 02:58 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-29-2007, 03:25 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 03:50 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-29-2007, 04:02 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 06:25 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:07 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 07:29 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:45 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:52 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 07:42 AM
RE: iGame3D Data Directories - iGame3D - 11-29-2007, 09:10 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 09:24 AM
RE: iGame3D MurgaLua'd - chrimo - 12-02-2007, 10:56 PM
RE: iGame3D MurgaLua'd - iGame3D - 12-03-2007, 04:46 AM
RE: iGame3D MurgaLua'd - chrimo - 12-03-2007, 06:50 AM
RE: iGame3D MurgaLua'd - Tobi - 12-03-2007, 07:09 AM
RE: iGame3D MurgaLua'd - chrimo - 12-09-2007, 12:18 AM
RE: iGame3D MurgaLua'd - chrimo - 12-09-2007, 09:32 PM
RE: iGame3D MurgaLua'd - mikshaw - 12-12-2007, 02:47 PM
RE: iGame3D MurgaLua'd - chrimo - 12-12-2007, 08:35 PM
RE: iGame3D MurgaLua'd - mikshaw - 12-13-2007, 01:31 AM
RE: iGame3D MurgaLua'd - iGame3D - 12-13-2007, 02:55 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: