Skip to content

textarea

Thomas S edited this page Jul 24, 2020 · 3 revisions

obj_uiZ_textarea

The ultimate way for the user to input multiple lines of text. It is very feature packed with features such as:

  • selecting text
  • copy and paste
  • typing characters like "Γ«", "Γ’", etc...
  • Keyboard shortcuts (home, end, arrow keys, shift to select)
  • rapid typing (print many characters when the user presses and holds a certain key)
  • horizontal text wrap
  • built in scrollbar

The textarea will draw a vertical only scrollbar when there isn't enough space for all text to be drawn vertically. Any horizontal text wider than the textarea is wrapped to the next line. This behaviour cannot be changed.

Property Variables

  • font[-1]: the font to use, a value of -1 means font will be ignored.
  • textcolor[c_black]: The color of the text.
  • selecttextcolor[c_white]: The color of the text when it is selected.
  • selectbackcolor[12820740 (aqua blue)]: The color of the background behind selected text.
  • scrollbarsize[0.2]: The width of the scroll bar (if necessary). (For more information, look into scrollbars)
  • scrollbarsizetype[dp]: The type of the width of the scroll bar. (For more information, look into scrollbars)
  • scrollbarsprite[spr_uiZ_scrollbar]: The sprite to use for the scroll bar. (For more information, look into scrollbars)
  • scrollbarcolor[c_white]: The color blend of the scroll bar. (For more information, look into scrollbars)
  • scrollbartexturemode[uiz_texturemode_fill]: The texture mode to use to fill the background of the scrollbar. (For more information, look into scrollbars)
  • scrollspeed[0.5]: The number of density pixels scrolled per scroll wheel input. (For more information, look into scrollbars)
  • 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.
  • accountspeed[.5]: Time in seconds of how long it will take before the string box enters "rapid mode" in which it continuously adds the key currently pressed.
  • accbetween[0.017]: Time in seconds of how fast characters will appear in "rapid mode". If this is set to 0.1, then every second 10 characters will be typed when rapid typing mode is enabled. (rapid typing mode is enabled when a user presses and holds a key). You can never type more characters per seconds than the room_speed (or fps for that matter).
  • typeanimationin[uiz_exponential_in]: The animation when the "|" icon appears when typing. This animation is applied to the alpha of the "breath in" animation.
  • typeanimationout[uiz_exponential_in]: The animation when the "|" icon disappears when typing. This animation is applied to the alpha of the "breath out" animation.
  • typeAnimationTime[1]: The time in seconds the typeanimationin and typeanimationout will take.
  • typecolor[c_black]: The color of the "|" icon that appears while typing.

Functions

  • uiz_textarea_setfont(instanceid,font[-1]):
    • instanceid: the instance id of the instance you want to modify
    • font: the font to use, a value of -1 means font will be ignored.
  • uiz_textarea_setcolor(instanceid,text[c_black],selection back[c_blue],type indicator[c_black]):
    • instanceid: the instance id of the instance you want to modify
    • text color: The color of the text.
    • selected text color: The color of the text when it is selected.
    • selected background color[12820740 (aqua blue)]: The color of the background behind selected text.
  • uiz_textarea_setscrollbarsettings(instanceid,size[0.2],sizetype[dp],sprite[spr_uiZ_scrollbar],color[c_white],texturemode[uiz_texturemode_fill],speed[1],animation[uiz_smoothstep],animation time[.2]):
    • instanceid: the instance id of the instance you want to modify
    • size: The width of the scroll bar (if necessary). (For more information, look into scrollbars)
    • sizetype: The type of the width of the scroll bar. (For more information, look into scrollbars)
    • sprite: The sprite to use for the scroll bar. (For more information, look into scrollbars)
    • color: The color blend of the scroll bar. (For more information, look into scrollbars)
    • texturemode: The texutremode to use to fill the background of hthe scrollbar. (For more information, look into scrollbars)
    • speed: The number of density pixels scrolled per scroll wheel input. (For more information, look into scrollbars)
    • animation: 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.
    • animation time: How long scrollbar animations should take in seconds.
  • uiz_textarea_setrapidmode(instanceid,time to activate[.5],seconds per character[0.017]): Rapid mode is enabled when the user presses and holds a key. Once enabled, the held key is activated over an over again with a given interval.
    • instanceid: the instance id of the instance you want to modify
    • time to activate: Time in seconds of how long it will take before the string box enters "rapid mode" in which it continuously adds the character currently.
    • seconds per character: Time in seconds of how fast characters will appear in "rapid mode". If this is set to 0.1, then every second 10 characters will be typed when rapid typing mode is enabled. You can never type more characters per seconds than the room_speed (or fps for that matter).
  • uiz_textarea_setcursoranimation(instanceid,animation in[uiz_exponential_in],animation out[uiz_exponential_in],time[1]):
    • instanceid: the instance id of the instance you want to modify
    • animation in: The animation when the "|" icon appears when typing.
    • animation out: The animation when the "|" icon disappears when typing.
    • time: The time in seconds the typeanimationin and typeanimationout will take.
  • uiz_textarea_resetSelection(instanceid): If the user has selected any text in the textarea, the text will be unselected after calling this function. If the user was typing in the textarea, the typing cursor will disappear and the user has to click the textarea again.
    • instanceid: the instance id of the instance you want to modify
  • uiz_textarea_setvalue(instanceid,value[""]):
    • instanceid: the instance id of the instance you want to modify
    • value: What text should be currently written inside of the textarea.
  • value=uiz_textarea_getvalue(instanceid):
    • value: What text is currently written inside of the textarea
    • instanceid: the instance id of the instance you want to read the property from

visuals

Wiki pages

🏑Home / General
πŸ“ƒTutorials
πŸ‘ͺ Parent
↕️ Positioning
πŸ›  Fixing & Updating
πŸ• Depth
πŸ“ƒ Templates and Examples
πŸŒ† Background
πŸ“‡ 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


🎈 Your own objects
🚫 Destroy
🐭 Mouse
πŸ’» Windows (uiz)
🌌 Animations
❓ General
πŸ“’ Numbers
πŸ“’ Strings
✏️ Draw
🚩 Popup
πŸ“‚ Files
πŸ’» Windows (os)
Clone this wiki locally