Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [nuklear-doc] About Menus

Author
Message
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 15th Oct 2020 07:15 Edited at: 17th Oct 2020 06:30
About Menus


There are a few workarounds here as well. Commands that expect an image as parameter must first save the corresponding images in slots or they must be created with an assigned name.

For storing in slots there are the commands:
Integer ImageToSlot0(slot, agk_img_id as Integer, x as Float, y as Float, w as Float, h as Float)
Integer ImageToSlot1(slot as Integer, agk_img_id as Integer)

For the name assignment are the commands:
Integer ImageCreate(name as String, agk_img_id as Integer, x as float, y as float, w as float, h as float)
Integer ImageCreate(name as String, agk_img_id as Integer)


Function overview (Plugin - .DLL/.SO)
  • MenubarBegin()
  • MenubarEnd()
  • Integer MenuBeginText(title as String, len as Integer, align nk_flags, width as Float, height as Float)
  • Integer MenuBeginLabel(label as String, align as Integer, width as Float, height as Float)
  • Integer MenuBeginImage(id as String, image_slot as Integer, width as Float, height as Float)
  • Integer MenuBeginImage(id as String, image_name as String, width as Float, height as Float)
  • Integer MenuBeginImageText(title as String, len as Integer, align as Integer, image_slot as Integer, width as Float, height as Float)
  • Integer MenuBeginImageText(title as String, len as Integer, align as Integer, image_name as String, width as Float, height as Float)
  • Integer MenuBeginImageLabel(title as String, align nk_flags, image_slot as Integer, width as Float, height as Float)
  • Integer MenuBeginImageLabel(title as String, align nk_flags, image_name as String, width as Float, height as Float)
  • Integer MenuBeginSymbol(id as String, sym as Integer, width as Float, height as Float)
  • Integer MenuBeginSymbolText(title as String, len as Integer, align as Integer, sym as Integer, width as Float, height as Float)
  • Integer MenuBeginSymbolLabel(title as String, align as Integer, sym as Integer, width as Float, height as Float)
  • Integer MenuItemText(title as String, len as Integer, align as Integer)
  • Integer MenuItemLabel(label as String, align as Integer)
  • Integer MenuItemImageLabel(image_slot as Integer, label as String, align as Integer)
  • Integer MenuItemImageLabel(image_name as String, label as String, align as Integer)
  • Integer MenuItemImageText(image_slot as Integer, text as String, len as Integer, align as Integer)
  • Integer MenuItemImageText(image_name as String, text as String, len as Integer, align as Integer)
  • Integer MenuItemSymbolText(sym as Integer, text as String, len as Integer, align as Integer)
  • Integer MenuItemSymbolLabel(sym as Integer, label as String, align as Integer)
  • MenuClose()
  • MenuEnd()



Parameter (Plugin)
  • Title, label
    Title of the menu item to be displayed.
  • len
    Length of the title in characters.
  • align
    Alignment of the text.
  • width
    Width of the panel.
  • height
    Height of the panel.
  • id
    String id of the item. Serves for identification (internal).
  • image_slot
    A previously created image slot.
  • image_name
    A previously created association to an image.
  • sym
    A Symbol from the symbol table.



Symbol constant
NK_SYMBOL_NONE
NK_SYMBOL_X
NK_SYMBOL_UNDERSCORE
NK_SYMBOL_CIRCLE_SOLID
NK_SYMBOL_CIRCLE_OUTLINE
NK_SYMBOL_RECT_SOLID
NK_SYMBOL_RECT_OUTLINE
NK_SYMBOL_TRIANGLE_UP
NK_SYMBOL_TRIANGLE_DOWN
NK_SYMBOL_TRIANGLE_LEFT
NK_SYMBOL_TRIANGLE_RIGHT
NK_SYMBOL_PLUS
NK_SYMBOL_MINUS
NK_SYMBOL_MAX


The commands Menu...Text and Menu...Label do not differ in their functionality. With the Label variant only the length of the title is removed. So it is also the preferred command for creating menus.

Previous topic (About Layouts & Groups) ———— Table of contents ———— Next topic (About Trees)



Example:
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2024-11-21 23:12:35
Your offset time is: 2024-11-21 23:12:35