HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: resizing buttonbar - resizers not looking right  (Read 907 times)

Thazager

  • General Accounts
  • *
  • Posts: 1149
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
resizing buttonbar - resizers not looking right
« on: Jun 08, 13, 10:11:50 PM »

I was making another GUI window, but with a button bar that allows you to change the sizes of the view ports for each category in the window. The resize sliders are partially working, in that they allow the user to make them bigger and smaller. But they don't show how they really look until you change the size of the window. This is one where some might need to see to understand, so I put this together to build it. This was put together quickly, so the button PICTURE on the bar is not perfect.

New Class  TMP_button
archetype =  guicontrol
parent =  _GUIButton

NewPrototype name =  TMP_button
class =  TMP_button

Properties of TMP_button
size =  100, 20
min size =  60, 20
max size =  200, 20
defaultStatePresentation color =  0,0,0,0
hoverStatePresentation color =  0,0,0,0

add  _label,  _resizeRight

Properties of _label
name =  text
dockmode =  FILL
justifcation =  CENTER
defaultStatePresentation color =  1,0,0,1

Properties of  _resizeRight
name = resizeRight
owner =  1
_____________________________________________________________________________________
NewPrototype name =  TMP_buttonBar
inheritFrom =  _panel

Properties of  TMP_buttonBar
texture =  \GUI\character_selection_1.dds
size =  200, 20
min size =  200, 20
max size =  2000, 20
defaultStatePresentation  position =  758, 187
         size =  240, 56
hoverStatePresentation  position =  758, 187
         size =  240, 56

add  _space,  3  TMP_button

Properties of  _spacer
name =  spacer
size =  20, 20
dockmode =  LEFT
defaultStatePresentation color =  0,0,0,0

Properties of 1st  TMP_button
name =  Namebutton
size =  60, 20
min size =  60, 20
dockmode =  LEFT

set  _label  text  = Name

Properties of 2nd  TMP_button
name =  Areabutton
size =  40, 20
min size =  40, 20
dockmode =  LEFT

set  _label  text  = Area

Properties of 3rd  TMP_button
name =  Joinedbutton
dockmode =  LEFT

set  _label  text  = Joined
_____________________________________________________________________________________
This next part uses the TMP_BaseWindow from the Developer Tutorial  Section.

New Class  TMP_GuildWindow
archetype =  guicontrol
parent =  _GUIBaseWindow

open script and add:
(yes, it needs BaseWindow as class)
Code: [Select]
// create window
shared function Start()
  win as NodeRef of Class TMP_BaseWindow = FindGUIControlByName(None, "game.TMP_GuildWindow" )
  if win <> None
    DestroyNode( win )
  .
  win = CreateNodeFromPrototype( "TMP_GuildWindow" )
  win.build = true
  win.owner = 0
  win.position.x = 200
  win.position.y = 200
.

 

NewPrototype name =  TMP_GuildWindow
inheritFrom =  TMP_BaseWindow

Properties of  TMP_GuildWindow
size =  200, 250
allowMove =  true
layer =  game

add  TMP_buttonBar
move  TMP_buttonBar  up in the list just under the  BackPanel

Properties of  TMP_buttonBar
position =  15, 40
anchor =  Top-true, Bottom-false, Left-true, Right-true
_____________________________________________________________________________________
In E_playerAccountClassMethods add  under the chat bar:

        TMP_GuildWindowClassMethods:Start()


You can move the sliders on the button bar, but they look kind of weird until you resize the main window. This is the part I was interested in, if anyone has this working yet?

(I was trying to make something like the script pickers, Is that Gui avail for viewing?)
« Last Edit: Jun 08, 13, 10:17:15 PM by Thazager »
Logged