-
Notifications
You must be signed in to change notification settings - Fork 2
drawdslist
Draws a ds_list of text (and sprites) out into a scrollable list. Each item can be selected with the mouse and you can choose whether you want selected items to be persistent. You can't disable the scroll bar.
This object cannot be fully utilized from the designer.
- uselist[-1]: What ds list to use for drawing the text items. This is your main list, and the number of items in the final list will depend on the items in your uselist. -1 means no list.
- usesprlist[-1]: This list adds little sprites on the left of your items. This list HAS to be the same size (or bigger) as the normal uselist. -1 means no list, and no sprites will be drawn. If a single item is -1 then no sprite will be drawn for that item.
- useimglist[-1]: This list defines the image index of the little sprites on the left of your items. This list HAS to be the same size (or bigger) as the normal uselist. -1 means no list, and all image indexes will be 0.
- color[c_white]: the default color of every item in the list.
- oncolor[c_ltgray]: the color of an item in the list when the mouse is over it.
- clickcolor[c_dkgray]: the color of an item in the list when the mouse clicks it.
- margin[2]: The space in pixels between 2 items.
- scrollbarwidth[16]: The width in pixels of the scrollbar.
- scrollbarsprite[spr_uiZ_scrollbar]: The sprite to use for the scroll bar, see uiz_drawscrollbar_ for more information.
- scrollbarbacktextmode[uiz_texturemode_fill]: How to draw the background. You can choose from uiz_texturemode_fill, texturemode_tile and texturemode_tilefit. See uiz_drawscrollbar_ for more information.
- countspeed[0.1]: Time in seconds of how long the "snap animation" should take when scrolling.
- graph[uiz_sin_inout]: What animation type to use for the "snap animation" when scrolling.
- keepselection[false]: Whether to keep something selected when the mouse releases something.
- scrollspeed[100]: How many pixels to scroll every time you scroll the scroll wheel or press the scrollbar buttons.
- sel: A number giving what item the mouse is pressing. -1 if nothing is selected.
- selected A number giving what item the mouse has pressed last. -1 if nothing has ever been selected.
-
uiz_drawdslist_setlist(instanceid,uselist,usesprlist,useimglist): set what should be displayed by this object
- instanceid: the instance id of the instance you want to modify
- uselist[-1]: required list containing the text that should be drawn on each list entry.
- usesprlist[-1]: optional list containing the sprites that should be drawn on the left of each list entry. Set to -1 to not use this feature.
- useimglist[-1]: optional list containing the sprite's image index that should be drawn on the left of each list entry. If you supply this list, the usesprlist also has to be supplied. Set to -1 to not use this feature.
-
uiz_drawdslist_setcolor(instanceid,color,oncolor,clickcolor):
- instanceid: the instance id of the instance you want to modify
- color[c_white]: the color of each list entry when the mouse is not hovering over that entry
- oncolor[c_ltgray]: the color of each list entry when the mouse is hovering over that entry
- clickcolor[c_dkgray]: the color of each list entry when the mouse is clicking that entry
-
uiz_drawdslist_setmargin(instanceid,margin):
- instanceid: the instance id of the instance you want to modify
- margin[2]: the space in pixels between two list entries
-
uiz_drawdslist_setscrollbar(instanceid,scrollbarwidth,scrollbarwidthtype,scrollbarsprite,scrollbarbacktexmode,scrollbarAnimationTime,scrollbarAnimation,scrollspeed)
- instanceid: the instance id of the instance you want to modify
- scrollbarwidth[0.16], scrollbarwidthtype[dp]: The width of the scrollbar
- scrollbarsprite[spr_uiZ_scrollbar]: what sprite to use for the scrollbar. For more details see scrollbar.
- scrollbacktexturemode[uiz_texturemode_fill]: How sprites should be stretched/tiled. You can choose the constants: uiz_texturemode_fill, uiz_texturemode_fill_edgeless, uiz_texturemode_tile, uiz_texturemode_tilefit.
- scrollbarAnimationTime[0.2]: How long scrollbar animations should take in seconds.
- scrollbarAnimation[uiz_smoothstep]: What animation to use when the scrollbar is in animation. The scrollbar may animate when using the scroll wheel or scroll buttons on the scrollbar.
- scrollspeed[100]: How many lines a single scroll (wheel up/down or button up/down) should do.
-
uiz_drawdslist_keepselection(instanceid,keepselection):
- instanceid: the instance id of the instance you want to modify
- keepselection[false]: Whether to keep a single list entry selected upon clicking on that entry.
-
sel=uiz_drawdslist_getselection(instanceid):
- sel: A number giving what item the mouse is pressing. -1 if nothing is selected.
- instanceid: the instance id of the instance you want to read the property from
-
selected=uiz_drawdslist_getselected(instanceid):
- selected A number giving what item the mouse has pressed last. -1 if nothing has ever been selected.
- instanceid: the instance id of the instance you want to read the property from
Here is the example code that created this image:
f=uiz_c(obj_uiZ_frame)
f.posinframex=px
f.posinframey=px
f.posvalx=100
f.posvaly=100
f.posvalw=100
f.posvalh=400
f.posvalwtype=px
f.posvalhtype=px
uiz_fixgeneralpos(f)
o=uiz_c(obj_uiZ_drawdslist)
uiz_setParent(o,f)
o.posinframex=uiz_fill
o.posinframey=uiz_fill
uselist=ds_list_create()
ds_list_add(uselist,"hello","this","is","an","item")
o.uselist=uselist
usesprlist=ds_list_create()
ds_list_add(usesprlist,spr_uiZ_button,spr_uiZ_buttons_load,spr_uiZ_folder,-1,spr_uiZ_buttons_switch)
o.usesprlist=usesprlist
uiz_fixgeneralpos(o)
πTutorials
Basics 1: Basic positioning
Basics 2: Parenting system
Basics 3: Advanced positioning
Basics 4: Advanced sizing and set point
Basics 5: Canvas and containment
Basics 6: Alpha and depth
Basics 7: Using the manual and Animations
Basics 8: Object backgrounds
Basics 9: Grids
Basics 10: Framesets
Basics 11: Windows
Basics 12: Scroll bars
βοΈ Positioning
π Depth
π Structures
π Objects
obj_uiZ_3waybutton
obj_uiZ_button
obj_uiZ_checkbox
obj_uiZ_clock
obj_uiZ_colorbox
obj_uiZ_cover
obj_uiZ_drawdslist
obj_uiZ_dropdown
obj_uiZ_easybutton
obj_uiZ_frame
obj_uiZ_framescrollbar
obj_uiZ_functionbar
obj_uiZ_gradientsquare
obj_uiZ_gradientroundrect
obj_uiZ_gridlist
obj_uiZ_huesquare
obj_uiZ_loadingbar
obj_uiZ_loadingcircle
obj_uiZ_menubutton
obj_uiZ_mousemenu
obj_uiZ_radiobox
obj_uiZ_rotator
obj_uiZ_slider
obj_uiZ_scrollbar
obj_uiZ_slider_2col
obj_uiZ_slickslider
obj_uiZ_slideframe
obj_uiZ_sprbutton
obj_uiZ_spriteanimationbutton
obj_uiZ_spritecounter
obj_uiZ_stringbox
obj_uiZ_sliderstruct
obj_uiZ_surfacecanvas
obj_uiZ_sprite
obj_uiZ_square
obj_uiZ_squarebutton
obj_uiZ_swipicon
obj_uiZ_switch
obj_uiZ_tabslider
obj_uiZ_tabs
obj_uiZ_treelist
obj_uiZ_text
obj_uiZ_text_background
obj_uiZ_textarea
obj_uiZ_valuebox
π Strings
uiz_addChar
uiz_changechar
uiz_charCanHaveAddon
uiz_returnCharAddon
uiz_charIsNumber
uiz_charIsNumberOrText
uiz_getlines
uiz_gettext_contained
uiz_gettextlines_contained
uiz_getValidVariableName
uiz_isSpaceChar
uiz_lastStringChars
uiz_removeChar
uiz_replaceChars_
uiz_string_copy
uiz_string_digits
uiz_string_format
uiz_string_fromReal
uiz_string_real_getFracLength
uiz_string_real_getIntLength
uiz_string_repeat
uiz_string_replace
uiz_string_pos_at
uiz_stringUntilNewline