Shape(3I)

πŸ’– Shape(3I) β€” like, the vibe of a canvas πŸ’–

okay bestie, so this is the InterViews Reference Manual page for Shape, and it's lowkey one of the most foundational lil guys in the whole toolkit. let's get into it 🫢


✨ NAME ✨

Shape β€” what shape a canvas should have 🌸


πŸŽ€ SYNOPSIS πŸŽ€

#include <InterViews/shape.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

So. A shape specifies the desired characteristics of a canvas. That's it, that's the whole job description. πŸ’…

An interactor should set the fields of its shape when it is reconfigured, and it should call Change on its parent if any of these fields change. yes, tell your parent, communication is key in every relationship bestie 😭

The dimensions of a shape are defined by a "natural" size, a stretch amount, and a shrink amount. The width and height fields indicate the desired sizes. The hstretch, vstretch, hshrink, vshrink fields define how flexible these desired sizes are. fr fr, it's giving ✨flexible✨

For example (and this example ate, ngl): an interactor may have a natural size of 100, but can adequately handle any size between 50 and 200. The stretchability for this case would be 100 and the shrinkability 50. math is mathing πŸ“

The constants hfil and vfil are provided to indicate "infinite" stretching or shrinking. They are represented as very large numbers and manipulated exactly the same as other stretch and shrink parameters. no special treatment, they're just like everyone else πŸ₯°

The aspect field specifies the desired aspect ratio. A value of zero means any aspect is acceptable β€” go off, be free, no notes.

The hunits and vunits fields indicate that the canvas dimensions should be multiples of some values. multiples, bestie. it's giving grid energy πŸ‘‘


πŸ’… PUBLIC OPERATIONS πŸ’…

  • Shape() β€” Construct a new shape with undefined natural size and infinite stretchability and shrinkability in both directions. a blank canvas, literally and figuratively 🎨
  • boolean Defined() and boolean Undefined() β€” Test if the shape's natural size is defined or not. yes or no, iconic or unknown πŸ™ˆ
  • void Rect(int width, int height) and void Square(int side) β€” Short-hand for setting the dimensions of the shape. Square sets both dimensions to side and sets the aspect ratio to one. equal sides, equal rights, periodt πŸŸͺ
  • void Rigid(int hshrink, int hstretch, int vshrink, int vstretch) and void Rigid() β€” Set the stretchability and shrinkability fields of the shape. If no arguments are specified, the fields are set to zero. zero flexibility, zero chill, rigid is rigid πŸ’€
  • void SetUndefined() β€” Reset the shape's natural size to be undefined. back to square one (but not Square one, don't get it twisted πŸ“)

πŸ‘€ SEE ALSO πŸ‘€

  • Interactor(3I)
  • Scene(3I)

and that's the whole page bestie!! πŸ’– this was the InterViews manual, 15 June 1987 β€” yes it's vintage, yes it still serves, iykyk ✨ slay, go set some shape fields, and remember: if anything changes, call Change on your parent. communication queen behavior only πŸ‘‘πŸŒˆπŸ¦‹