Skip to content

posinframe

Thomas edited this page Dec 29, 2019 · 2 revisions

posinframe

These variables affect in what way the variables posvalx, posvaly, posvalw, posvalh, topframemargin, leftframemargin, rightframemargin, frameframemargin react.
They can also make these variables ineffective.
You can use this to set the "mode" of how an object is placed, or how values are interpreted.
Variables that indicate a position always come in pairs. For example "posvalx" has "posinframex" as its friend. "posinframex" defines the type of value that "posvalx" represents.
Also, keep in mind that not every variable supports all variable types. These constants do not all apply to "posvalwtype" and "posvalhtype" for example.

In the code snippets in the table below "p." is referring to the parent and "spx" refers to a corresponding "setpointx/y" value.
These variables can differ with different combinations of posinframex and posinframey.*
"all" refers only to the variables "posvalx", "posvaly", "posvalw", "posvalwtype", "posvalh" and "posvalhtype".

Picking any other values that the given constants can result in an error which will be given inside the compile log window. The variable will behave like uiz_static in that case.

There are a few constants this variable can be set to:

Variable Type Explanation
uiz_snapleft

Places the object on the left side of the parent (not of the screen, unless no parent is set).
Obeys the "leftframemargin" variable that needs to be set on the object that should obey it.
Only has effect on the x coordinates.
Disables the variable "posvalx" variable, but enables the "posvalw" and "posvalwtype" variables.
NOT the same as uiz_left
Default setpointx=uiz_left (applies if set to uiz_auto)
Calculated using: "leftframemargin-width*spx"

uiz_snapright Places the object on the right side of the parent (not of the screen, unless no parent is set). Obeys the "rightframemargin" variable that needs to be set on the object that should obey it. Only has effect on the x coordinates. Disables the variable "posvalx" variable, but enables the "posvalw" and "posvalwtype" variables. NOT the same as uiz_right Default setpointx=uiz_right (applies if set to uiz_auto) Calculated using: "p.width-rightframemargin-width*spx"
uiz_snaptop Places the object on the top side of the parent (not of the screen, unless no parent is set). Obeys the "topframemargin" variable that needs to be set on the object that should obey it. Only has effect on the y coordinates. Disables the variable "posvaly" variable, but enables the "posvalh" and "posvalhtype" variables. NOT the same as uiz_top Default setpointy=uiz_top (applies if set to uiz_auto) Calculated using: "topframemargin-height*spx"
uiz_snapbottom Places the object on the bottom side of the parent (not of the screen, unless no parent is set). Obeys the "bottomframemargin" variable that needs to be set on the object that should obey it. Only has effect on the y coordinates. Disables the variable "posvaly" variable, but enables the "posvalh" and "posvalhtype" variables. NOT the same as uiz_bottom Default setpointy=uiz_bottom (applies if set to uiz_auto) Calculated using: "p.height-bottomframemargin-height*spx"
uiz_center Places the object in the middle of the parent (not of the screen, unless no parent is set). Can be set for both "posinframex" and "posinframey". *Disables the variable "posvalx" and "posvaly" variable, but enables the "posvalw", "posvalwtype", "posvalh" and "posvalhtype" variables.* NOT the same as uiz_middle Default setpointx=uiz_middle (applies if set to uiz_auto) Default setpointy=uiz_middle (applies if set to uiz_auto) Calculated using: "p.height-bottomframemargin-height*spx"
uiz_fill Fills the object in parent (not of the screen, unless no parent is set). *Obeys the "leftframemargin", "rightframemargin", "topframemargin" and "bottomframemargin" variable that needs to be set on the object that should obey it.* Can be set for both "posinframex" and "posinframey". *Disables the variable "posvalx", "posvaly", "posvalw", "posvalwtype", "posvalh" and "posvalhtype" variables.* NOT the same as uiz_middle setpointx/y have no effect on uiz_fill Calculated using: "x=leftframemargin; width=p.width-rightframemargin-leftframemargin;" or: "y=topframemargin; height=p.height-bottomframemargin-topframemargin;"
px Places the object an amount of pixels inside the parent.. Stands for "pixel". A value of 100 px will mean the position will be 100 pixels away from the left/top side of the parent. A value of 0 px will mean the position will be on the left/top side of the parent. Can be set for both "posinframex" and "posinframey". **Enables all variables.** Calculated using: "x=posvalx-width*spx;" or: "y=posvaly-height*spx;"
fc Places the object relative to the size of the parent. Stands for "factor". A value of 1 fc will mean the position will be on the right/bottom side of the parent. A value of 0 fc will mean the position will be on the left/top side of the parent. A value of 0.5 fc will mean the position will be in the middle of the parent. Must be 0 or higher, and 1 or lower. ( 0<=posval<=1 ) Can be set for both "posinframex" and "posinframey". **Enables all variables.** Calculated using: "x=posvalx*p.width-width*spx;" or: "y=posvaly*p.height-height*spx;"
fcx Places the object relative to the width of the parent. Stands for "factor-x". About the same as fc, but forces the use of the width of the object. Has no difference with fc if used on posinframex, but does make a difference when used with posinframey. Must be 0 or higher, and 1 or lower. ( 0<=posval<=1 ) Can be set for both "posinframex" and "posinframey". **Enables all variables.** Calculated using: "x=posvalx*p.width-width*spx;" or: "y=posvaly*p.width-height*spx;"
fcy Places the object relative to the height of the parent. Stands for "factor-y". About the same as fc, but forces the use of the height of the object. Has no difference with fc if used on posinframey, but does make a difference when used with posinframex. Must be 0 or higher, and 1 or lower. ( 0<=posval<=1 ) Can be set for both "posinframex" and "posinframey". **Enables all variables.** Calculated using: "x=posvalx*p.height-width*spx;" or: "y=posvaly*p.height-height*spx;"
fcm Places the object relative to the width and height of the parent. Stands for "factor-mean". About the same as fc, but takes the mean between the width and height of the object's parent. A mix between fcx and fcy. Must be 0 or higher, and 1 or lower. ( 0<=posval<=1 ) Can be set for both "posinframex" and "posinframey". **Enables all variables.** Calculated using: "x=mean(posvalx*p.width-width*spx,posvaly*p.height-height*spy);" or: "y=mean(posvalx*p.width-width*spx,posvaly*p.height-height*spy);"
dp Places the object relative to the display density. Short for "density pixels". 2 displays may both have a resolution of 1920x1080, but one may be 5 inch and the other 27 inch. dp tries to make distances the same irl. Can be set for both "posinframex" and "posinframey". **Enables all variables.** Calculated using: "x=posvalx*display_get_dpi_x()-width*spx;" or: "y=posvaly*p.width-width*spx;"
uiz_snapparentrx Will place the object at the position of it's parent's rx value. Setpointx and setpointx still have effect. Can be only set for "posinframex".
uiz_snapparentry Will place the object at the position of it's parent's ry value. Setpointx and setpointy still have effect. Can be only set for "posinframey".
uiz_snapparentrlx Will place the object at the position of it's parent's rx value. Setpointx and setpointx still have effect. Can be only set for "posinframex".
uiz_snapparentrly Will place the object at the position of it's parent's rly value. Setpointx and setpointy still have effect. Can be only set for "posinframey".
uiz_static Doesn't do anything, allows you to specify your own x,y. **Disables all variables.** Not calculated

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