Skip to content

huequare

Thomas edited this page Aug 1, 2020 · 3 revisions

obj_uiZ_huesquare

An object usable for a hue/saturation input field. Drawn using shaders (or sprite if shaders aren't available). This object has a little pointer square that can be dragged to any position on the square to return a color. When clicking on an empty spot on the huesquare the pointer square will move to the clicked position using an animation.

Property Variables

  • h[0]: The hue value (0 for left, 255 for right) of where the pointer is. This setting can be changed by user input.
  • s[0]: The saturation value (0 for bottom, 255 for top) of where the pointer is. This setting can be changed by user input.
  • v[255]: The value value (from 0 to 255) of what the square should be. This setting can NOT be changed by user input.
  • squaresize[3]: How big the pointer square should be, from the center to the closest edge. A value of 3 whould mean a size of 6x6 pixels.
  • animation[true]: whether animations on this object should be enabled.
  • hanimationtype[uiz_quadratic_out]: What animation the pointer should have for the horizontal h value when you move it.
  • sanimationtype[uiz_quadratic_out]: What animation the pointer should have for the vertical s value when you move it.
  • rgbanimationtype[uiz_quadratic_out]: What animation the inr, inb and ing value should have.
  • anicountspeed[0.4]: How long the animation should take in seconds.

Functions

  • uiz_huesquare_setcolor_hsv(instanceid,h,s,v):
    • instanceid: the instance id of the instance you want to modify
    • h[0]: The hue value (0 for left, 255 for right) of where the pointer is. This setting can be changed by user input.
    • s[0]: The saturation value (0 for bottom, 255 for top) of where the pointer is. This setting can be changed by user input.
    • v[255]: The value value (from 0 to 255) of what the square should be. It controls the brightness of the huesquare where 0 is black and 255 is colored/white. This setting can NOT be changed by user input.
  • color = uiz_huesquare_getcolor(instanceid):
    • color: The color (not animated or interpolated) that is selected on the huesquare.
    • instanceid: the instance id of the instance you want to modify
  • color = uiz_huesquare_getcolor_animation(instanceid):
    • color: The color (animated and interpolated) that is selected on the huesquare. The color value is constantly updated while the selection square is moving.
    • instanceid: the instance id of the instance you want to modify
  • uiz_huesquare_setpointersettings(instanceid,size):
    • instanceid: the instance id of the instance you want to modify
    • size[3]: How big the pointer square should be, from the center to the closest edge. A value of 3 whould mean a size of 6x6 pixels.
  • uiz_huesquare_setanimation(instanceid,enabled,hanimation,sanimation,rgbanimation,time):
    • instanceid: the instance id of the instance you want to modify
    • enabled[true]: whether animations on this object should be enabled.
    • hanimationtype[uiz_quadratic_out]: What animation the pointer should have for the horizontal h value when you move it.
    • sanimationtype[uiz_quadratic_out]: What animation the pointer should have for the vertical s value when you move it.
    • rgbanimationtype[uiz_quadratic_out]: What animation the inr, inb and ing value should have.
    • time[0.4]: How long the animation should take in seconds.

Readable variables

  • anicount: A value from 0 to one indicating how far an animation is with playing.
  • h: A value indicating the hue value of where the pointer is. Animations are ignored and this value will change instantly when the user presses somewhere on the huesquare.
  • inh: This is a hue value that is constantly updated during animations.
  • fromh: The old hue value of where the hue used to be during an animation.
  • s: A value indicating the saturation value of where the pointer is. Animations are ignored and this value will change instantly when the user presses somewhere on the huesquare.
  • ins: This is a saturation value that is constantly updated during animations.
  • froms: The old saturation value of where the saturation used to be during an animation.
  • color: Which color the user selected(a game maker color code).
  • tor: Will give you a converted red color value. Animations are ignored and this value will change instantly when the user presses somewhere on the huesquare.
  • inr: Will give you a converted red color value which updates during animations.
  • fromr: The old red value of what the old red value was before an animation, while an animation is going on.
  • tob: Will give you a converted blue color value. Animations are ignored and this value will change instantly when the user presses somewhere on the huesquare.
  • inb: Will give you a converted blue color value which updates during animations.
  • fromb: The old blue value of what the old blue value was before an animation, while an animation is going on.
  • tog: Will give you a converted green color value. Animations are ignored and this value will change instantly when the user presses somewhere on the huesquare.
  • ing: Will give you a converted green color value which updates during animations.
  • fromg: The old green value of what the old green value was before an animation, while an animation is going on.
  • incolor: Will give you a color value which updates during animations.
  • icolor: Which color the little pointer square has.
  • update: Whenever any value changes during an animation.
  • updated: Whenever the color changes, but it ignores animations, and is only true for one step.

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