Documentation Registry @ Mill #6
Announcement: Under Construction!Code Documentation
Code developed by Mill #6 has been documented using their own codoc utility. The following documentation sets are on this site:
- cartesia
- cartesia-js
- codoc
- peppermill
- pixmill
- pixmill-js
- webfx
- xapi
PixMill Color Tables
The PixMill libraries, both Ruby and JS versions, define named color tables for use in UI code for their respective languages.
- NCS
- Resene
- W3C
Cartesia: 2D Geometry Operations (1.4.3)
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/angle.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/arc.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/bezier.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/catenary.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/chainwrap.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/circle.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/hexcoordinatesystem.rb | Ruby | Kenneth F. Guerin | Copyright © 2022-2024, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/hexgeometry.rb | Ruby | Kenneth F. Guerin | Copyright © 2022-2024, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/line.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/point.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/polygon.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/singletons.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| ext/cartesia/bezier.c | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/cartesia.h | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/circle.c | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/ellipse.c | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/extconf.h | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/extconf.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| ext/cartesia/init.c | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/point.c | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/singletons.c | CRuby | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
| ext/cartesia/utils.c | C | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
Contents Directory
Module: Cartesia
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/angle.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/arc.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/bezier.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/catenary.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/chainwrap.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/circle.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/hexcoordinatesystem.rb | Ruby | Kenneth F. Guerin | Copyright © 2022-2024, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/hexgeometry.rb | Ruby | Kenneth F. Guerin | Copyright © 2022-2024, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/line.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/point.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/polygon.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
| lib/cartesia/singletons.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This module handles 2D geometric calculations.
Singleton Registry
Singleton Details
angle!(angle) → Angle
Check and/or convert an angle to a Cartesia::AngleParameters:
- angle [Numeric or Angle] — the incoming angle arg
Returns:
- [Angle] — a Cartesia::Angle object
cp2pt(cp) → Point
Construct a Point from a 2-element array of coordinates.Parameters:
- cp [Array<Numeric>] — the coordinate pair
Returns:
- [Point] — the Cartesia::Point object
cpv2pts(cps) → Array<Point>
Construct an array of Points from an array of coordinates.Parameters:
- cps [Array<Numeric>] — the numeric coordinates
Returns:
- [Array<Point>] — the array of Cartesia::Points
d2angle(d) → Angle
Construct an Angle instance from a degree angle measurement.Parameters:
- d [Numeric] — the angle in degrees
Returns:
- [Angle] — a Cartesia::Angle instance
is_valid_coordinate_pair?(ary) → Boolean
Checks to see if an array is a valid coordinate pairParameters:
- ary [Array<Numeric>] — the coordinate pair array
Returns:
- [Boolean] — true if the array is composed of 2 numeric elements
new_arc_from_circle(circle, bearing_slice) → Arc
Construct an Arc from a Circle and a bearing slice.Parameters:
- circle [Circle] — the circle of which the resulting arc is a segment
- bearing_slice [Array<Numeric>] — a 2-element array of angles defining the slice of the circle
Returns:
- [Arc] — the Cartesia::Arc instance
new_line_segment(reference, endpt) → Line
Constructs a line segment from two coordinate pairsParameters:
- reference [Array<Numeric>] — the reference point of the line segment
- endpt [Array<Numeric>] — the end point of the line segment
Returns:
- [Line] — the new line segment
new_rect(point, width, height) → Polygon
Construct a rectangular Polygon from a Point and the width and height dimensionsParameters:
- point [Point] — the upper left point of the rectangle
- width [Numeric] — the width of the rectangle
- height [Numeric] — the height of the rectangle
Returns:
- [Polygon] —
new_square(point, size) → Polygon
Construct a square Polygon from a Point and the size dimensionsParameters:
- point [Point] — the upper left point of the rectangle
- size [Numeric] — the width of the rectangle
Returns:
- [Polygon] —
point!(pt) → Point
Check and/or convert a point to a Cartesia::PointParameters:
- pt [Array<Numeric> or Point or Symbol] — the incoming point arg
Returns:
- [Point] — a Cartesia::Point object
points!(pt) → Array<Point>
Check and/or convert an array of points or numeric coordinates to an arrya of Cartesia::PointsParameters:
- pt [Array<Numeric> or Array<Point> or Array<Array<Numeric>>] — the incoming point array arg
Returns:
- [Array<Point>] — theh array of Cartesia::Points
r2angle(r) → Angle
Construct an Angle instance from a radian angle measurement.Parameters:
- r [Numeric] — the angle in radians
Returns:
- [Angle] — a Cartesia::Angle instance
s2angle(s) → Angle
Construct an Angle instance from a secton angle measurement.Parameters:
- s [Numeric] — the angle in sectons
Returns:
- [Angle] — a Cartesia::Angle instance
Class: Cartesia::Angle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/angle.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all angle-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(m, uom)
Parameters:
- m [Numeric or Cartesia::Angle] — the initial value of the angle
- uom [Symbol] — the unit of measurement for the value <default: :radians>
Method Details
+ → Angle
Create a new Angle instance with an angle measurement of the current Angle's measurement added by specified unitsReturns:
- [Angle] — a new Angle instance
- → Angle
Create a new Angle instance with an angle measurement of the current Angle's measurement subtracted by specified unitsReturns:
- [Angle] — a new Angle instance
< → Boolean
Compare two angles for less thenReturns:
- [Boolean] — true if the angles are equal
<= → Boolean
Compare two angles for less than or equalReturns:
- [Boolean] — true if the angles are equal
== → Boolean
Compare two angles for equalityReturns:
- [Boolean] — true if the angles are equal
> → Boolean
Compare two angles for greater thanReturns:
- [Boolean] — true if the angles are equal
>= → Boolean
Compare two angles for greater than or equalReturns:
- [Boolean] — true if the angles are equal
add(m, uom) → Angle
Create a new Angle instance with an angle measurement of the current Angle's measurement added by specified unitsParameters:
- m [Numeric or Cartesia::Angle] — the initial value of the angle
- uom [Symbol] — the unit of measurement for the value <default: :radians>
Returns:
- [Angle] — a new Angle instance
add!(m, uom) → Angle
Add an angle measurement to an existing AngleParameters:
- m [Numeric or Cartesia::Angle] — the initial value of the angle
- uom [Symbol] — the unit of measurement for the value <default: :radians>
Returns:
- [Angle] — the current Angle instance
clamp! → Angle
Ensure that an angle measurement is between 0 and RAD360Returns:
- [Angle] — the current Angle instance
degrees → Numeric
Unit conversion methodReturns:
- [Numeric] — the measure of the angle in degrees
delta → Angle
Returns:
- [Angle] — a new Angle instance
delta! → Angle
Returns:
- [Angle] — the current Angle instance
difference → Angle
Calculate the difference between two anglesReturns:
- [Angle] — the difference between two angles
reflect_around_pi → Angle
Returns:
- [Angle] — a new Angle instance
reflect_around_pi! → Angle
Ensure that ...Returns:
- [Angle] — the current Angle instance
reflect_toward_zero → Angle
Returns:
- [Angle] — a new Angle instance
reflect_toward_zero! → Angle
Returns:
- [Angle] — the current Angle instance
sectons → Numeric
Unit conversion methodReturns:
- [Numeric] — the measure of the angle in sectons
set(m, uom)
Sets the value for the angleParameters:
- m [Numeric or Cartesia::Angle] — the initial value of the angle
- uom [Symbol] — the unit of measurement for the value <default: :radians>
to_s → String
String conversion methodReturns:
- [String] — the measure of the angle in radians as a String
u2r(m, uom) → Numeric <private>
Unit conversion method used to extract radian measurements from a variety of sources.Parameters:
- m [Numeric or Cartesia::Angle] — the measure of the angle to convert / extract
- uom [Symbol] — the unit of measurement for the value (ignored if m is a Cartesia::Angle) <default: :radians>
Returns:
- [Numeric] — the angle measurement in radians
Class: Cartesia::Arc ← Cartesia::Circle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/arc.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all arc-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(center, radius, bearing_slice)
Parameters:
- center [Point] — the center point of the circle
- radius [Numeric] — the radius of the circle
- bearing_slice [Array<Angle>] — a 2-element array of angles defining the bearings of the arc slice
Method Details
intersection_from_line(line) → Array<Point>
Calculate the intersection of the arc with a specified lineParameters:
- line [Line] — the line to compare against
Returns:
- [Array<Point>] — the points which intersect, or :outside
to_s → String
String conversion methodReturns:
- [String] — the string representation of the arc
Class: Cartesia::Bezier
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/bezier.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all bezier-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(pts)
Parameters:
- pts [Array<Point> or Array<Numeric>] — an array of points defining the Bezier curve
Method Details
e_points(intervals)
Parameters:
- intervals [Integer] — the number of intervals between the start and end of the bezier curve
is_valid? → Boolean
Returns:
- [Boolean] — true if the bezier curve is of a known type (cubic or quadratic)
length → Integer
This function returns the length of the bezier curveReturns:
- [Integer] — the length of the bezier curve in units
t_points(intervals)
Parameters:
- intervals [Integer] — the number of intervals between the start and end of the bezier curve
Class: Cartesia::Catenary
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/catenary.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all catenary-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(methods)
Parameters:
- methods [Hash] — the data defining the catenary curve (variants exist)
Method Details
calc_a_give_dxphi(dx, phi) → Number <private>
Parameters:
- dx [Number] — the dx value of the curve
- phi [Number] — the phi value of the curve
Returns:
- [Number] — the calculated a value
calc_a_give_dydx(dy, dx) → Number <private>
Parameters:
- dy [Number] — the dy value of the curve
- dx [Number] — the dx value of the curve
Returns:
- [Number] — the calculated a value
calc_a_give_dyphi(dy, phi) → Number <private>
Parameters:
- dy [Number] — the dy value of the curve
- phi [Number] — the phi value of the curve
Returns:
- [Number] — the calculated a value
ct_first(point, distance_from) → Point
Parameters:
- point [Point] — the initial reference piont <default: nil>
- distance_from [Number] — the distance from the point <default: nil>
Returns:
- [Point] — the first tracking point
ct_next(distance_from) → Point
Parameters:
- distance_from [Number] — the distance from the current tracked point
Returns:
- [Point] — the next tracking point
ct_track_point(op, pt, distance, precision) → Point <private>
Parameters:
- op [Symbol] — the tracking operation, values are { :first, :next }
- pt [Point] — the reference point
- distance [Number] — the distance from the reference point
- precision [Number] — the dx value of the curve <default: 3>
Returns:
- [Point] — the next tracked point
dy_at_dx(dx) → Number
Parameters:
- dx [Number] — the dx value
Returns:
- [Number] — the dy value
dy_at_dx(dy) → Number
Parameters:
- dy [Number] — the dy value
Returns:
- [Number] — the dx value
finish_curve_tracking
This method takes the curve out of a tracking state.phi_at_dx(dx) → Number
Parameters:
- dx [Number] — the dx value
Returns:
- [Number] — the phi value
phi_at_dy(dy) → Number
Parameters:
- dy [Number] — the dy value
Returns:
- [Number] — the phi value
s_at_dx(dx) → Number
Parameters:
- dx [Number] — the dx value
Returns:
- [Number] — the s value
s_at_dy(dy) → Number
Parameters:
- dy [Number] — the dy value
Returns:
- [Number] — the s value
start_curve_tracking(anchor, dx, style, direction) → Boolean
Parameters:
- anchor [Point] — the anchor point of the catenary curve
- dx [Number] — the distance from the anchor point
- style [Symbol] — the style of curve tracking, values are { :px, :nx, :invpx, :invnx }
- direction [Symbol] — the direction of the track, values are { :a2e, :e2a }
Returns:
- [Boolean] — the tracking state of the catenary curve
to_s → String
String conversion methodReturns:
- [String] — the string representation of the catenary curve
tracking? → Boolean
Returns:
- [Boolean] — the tracking state of the catenary curve
Class: Cartesia::ChainWrap
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/chainwrap.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class implements a chain wrapping algorithm (useful for tank tread graphics).
There are expectations:
Bogies are a list of Hashes, each containing the following information: - :type :: one of { :drive,:road,:rear,:top } in that order in the list :: with :tension bogies that can appear between runs of specific types :: See British Churhills - :cx :: center point of the bogie - :cy :: center point of the bogie - :r :: physical radius of the bogie - :z :: the front/back order of the bogies (not needed for this class) - :teeth :: #teeth of the drive bogie (:drive only, not needed for this class)
The position of the bogies can be based off of some offset. If provided, it must be an array: [ dx,dy ].
Catgrav_hints is a 2-element array of angles for catgrav treads. The values are in degrees. [0] is for the drive bogie, [1] is for the rear bogie.
Constructor Registry
Constructor Details
new(bogies, style, link_thinkness, link_length, links_per_tooth, offset, catgrav_hints)
Parameters:
- bogies [Array<Hash>] — the list of bogies to wrap the chain around
- style [] —
- link_thinkness [Number] — the thickness of the chain
- link_length [Number] — the length of each link of the chain
- links_per_tooth [Number] — the number of links per bogie tooth <default: 1>
- offset [Point] — an offset point <default: nil>
- catgrav_hints [Hash] — catenary curve information for chains/treads that are not taut <default: nil>
Class: Cartesia::Circle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/circle.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all circle-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(center, radius)
Parameters:
- center [Point] — the center point of the circle
- radius [Numeric] — the radius of the circle
Method Details
!=(circle) → Boolean
Inequality methodParameters:
- circle [Circle] — the circle to compare against
Returns:
- [Boolean] — true if the circles are not identical
==(circle) → Boolean
Equality methodParameters:
- circle [Circle] — the circle to compare against
Returns:
- [Boolean] — true if the circles are identical
bounding_box → Polygon
Return the bounding box enclosing the circleReturns:
- [Polygon] — the bounding box (square) enclosing the circle
closest_intersection_point_from_point(point) → Point
Calculate the closest intersection point on a circle from a given pointParameters:
- point [Point] — the point to compare against
Returns:
- [Point] — the point on the circle closest to the given point
distance_from_point(point) → Numeric
Calculate the closest distance between a given point and the circleParameters:
- point [Point] — the point to compare against
Returns:
- [Numeric] — the closest distance between the point and any point on the circle
get_chord_angle_by_length(length) → Angle
Get the chord angle defined by the length of the chordParameters:
- length [Numeric] — the length of the chord
Returns:
- [Angle] — the angle defining the chord
get_chord_length_by_angle(angle) → Numeric
Get the length of a specific chord on the CircleParameters:
- angle [Angle] — the angle defining the chord
Returns:
- [Numeric] — the length of the specified chord
get_chord_length_by_nsegs(nsegs) → Numeric
Get the length of a specific chord on the CircleParameters:
- nsegs [?Numeric] — the number of equidistance segments defining the chord
Returns:
- [Numeric] — the length of the specified chord
get_chord_points_by_len(length, direction, first_angle)
Get a set of chord points on a circleParameters:
- length [Numeric] — the length of each chord
- direction [Symbol] — the direction of travel around the circle { :cw, :ccw }
- first_angle [Angle] — the angle on the circle to start at
get_chord_points_by_n(npts) → Array<Point>
Get a number of equidistant points around a circle beginning at a specified angleParameters:
- npts [Integer] — the number of points around the circle to get
Returns:
- [Array<Point>] — an array of Points around the Circle
get_point(angle) → Point
Get a point on the circle at a given angle from the centerParameters:
- angle [Angle] — the angle from center where the point is located
Returns:
- [Point] — the point on the circle
get_tangent_line_between_circles(circle, connection) → Line
Calculate the tangent lines which can connect two circlesParameters:
- circle [Circle] — the circle to connect with
- connection [Symbol] — the type of connection { :cwcw, :ccwccw, :cwccw, :ccwcw }
Returns:
- [Line] — one of the tangent lines between the circles, or nil if there is no connection
get_tangent_vectors(bearing) → Hash<Line>
Get tangent vectors at a specific point on a circleParameters:
- bearing [Angle] — the bearing from center defining the point's location
Returns:
- [Hash<Line>] — the two tangent vectors emanating from the point
intersection_with_circle(circle) → Hash
Calculate the intersection point(s) with a given circleParameters:
- circle [Circle] — the circle to compare against
Returns:
- [Hash] — the point(s) and bearing(s) which intersect, or one of { :infinite, :outside }
intersection_with_line(line) → Array<Point>
Calculate the intersection point(s) with a given lineParameters:
- line [Line] — the line to compare against
Returns:
- [Array<Point>] — the point(s) which intersect, or the symbol :outside
is_point_inside?(point) → Boolean
Is a given point inside the circleParameters:
- point [Point] — the point to compare against
Returns:
- [Boolean] — true if the point is inside or on the circle
to_s → String
String conversion methodReturns:
- [String] — the string representation of the circle
Class: Cartesia::HexCoordinateSystem
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/hexcoordinatesystem.rb | Ruby | Kenneth F. Guerin | Copyright © 2022-2024, Kenneth F. Guerin, all rights reserved. |
Overview
This class implements a triangular coordinate system within a hexagon
Constructor Registry
Method Registry
Constructor Details
new(cpoint, size, granularity, orientation)
Parameters:
- cpoint [Point] — the center point of the hexagon in the outside coordinate system
- size [Numeric] — the edge-to-edge size of the hexagon
- granularity [Numeric] — the number of coordinates along the e-axis from the center point to each edge
- orientation [Symbol] — whether the hexagon is wide or tall <default: :wide>
Method Details
coord_delta(e, v, contrain) → Array<Numeric> <private>
Calculate the delta point at the specified hex-based coordinateParameters:
- e [Integer] — the e-coordinate value
- v [Integer] — the v-coordinate value
- contrain [Integer] — check coordinate value constraints <default: false>
Returns:
- [Array<Numeric>] — the x-delta / y-delta pair
each
Iterate across all points in the hex coordinate system, along the edge-axis firsteach_point_along_edge_axis(e)
Iterate along the specified edge-axisParameters:
- e [Numeric] — the e-coordinate to iterate along
is_constrained?(e, v) → Boolean <private>
Check the constraint of the e,v (edge,vertex) coordinate pairParameters:
- e [Integer] — the e-coordinate value
- v [Integer] — the v-coordinate value
Returns:
- [Boolean] — whether the e,v coordinate pair is constrained to the hex area
is_edge_point?(pt) → Boolean
Is the given point on the outside edge of the hexagonParameters:
- pt [Point] — the point to check
Returns:
- [Boolean] — true if the given point is on the outside edge of the hexagon
nv_at_e(e) → Integer
Calculate the number of coordinates along the v-axis at a specified e-coordinateParameters:
- e [Integer] — the e-coordinate value
Returns:
- [Integer] — the number of v-coordinates along the v-axis at e
point_at(pt, constrain) → Point
Calculate the point within a hex under on a specified HCS pointParameters:
- pt [Point] — the HCS coordinate point within the hex coordinate system
- constrain [Boolean] — whether the coordinate should be constrained to the hex area <default: true>
Returns:
- [Point] — the calculated point at some offset from the hexagon's center point
rotated_point(pt, segments) → Point
Calculate a new HCS point from a specified HCS point rotated N 60-degree segments clockwise around the centerParameters:
- pt [Point] — the original HCS coordinate
- segments [Integer] — the number of 60-degree segments to rotate the point clockwise
Returns:
- [Point] — the rotated HCS coordinate
Class: Cartesia::HexGeometry
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/hexgeometry.rb | Ruby | Kenneth F. Guerin | Copyright © 2022-2024, Kenneth F. Guerin, all rights reserved. |
Overview
This singleton class implements hexagon-specific geometric formulae.
Class Method Registry
Class Method Details
ee2vv(size) → Numeric
Calculate the hexagon's vertex-to-vertex size from its edge-to-edge sizeParameters:
- size [Numeric] — the hexagon's edge-to-edge size
Returns:
- [Numeric] — the vertex-to-vertex size of the hexagon
get_vertex_offsets(size) → Array<Numeric>
Return a list of the 3 hex vertex offset values from the center point. The first offset value is the e-axis offset to the flat edge. The second offset value is the v-axis offset to the vertex aligned with the center point. The third offset value is the v-axis offset to the other vertices.Parameters:
- size [Numeric] — the hexagon's edge-to-edge size
Returns:
- [Array<Numeric>] — the hexagon's vertex offsets
vv2ee(size) → Numeric
Calculate the hexagon's edge-to-edge size from its vertex-to-vertex sizeParameters:
- size [Numeric] — the hexagon's edge-to-edge size
Returns:
- [Numeric] — the vertex-to-vertex size of the hexagon
Class: Cartesia::Hexagon
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/polygon.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all hexagon-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(cpoint, size, orientation)
Parameters:
- cpoint [Numeric] — the center point of the hexagon
- size [Numeric] — the (flat) edge-to-edge size of the hexagon
- orientation [] — the orientation of the hexagon
Method Details
height → Numeric
Returns:
- [Numeric] — the height of the hexagon
width → Numeric
Returns:
- [Numeric] — the width of the hexagon
Class: Cartesia::Line
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/line.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all line-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(options)
Parameters:
- options [Hash] — the initial parameters of the line
Method Details
closest_intersection_point_from_point(point, force_infinite) → Point
Calculate the closest intersection point on a line to a given point.Parameters:
- point [Point] — the point to intersect with
- force_infinite [Boolean] — ignore vector/segment line length limits
Returns:
- [Point] — a point on a line closest to the given point
distance_from_point(point) → Numeric
Calculate the closest distance between a line to a given point.Parameters:
- point [Point] — the point to intersect with
Returns:
- [Numeric] — the closest distance to the given point
intersection_point(line) → Point] the intersection point, or nil if no intersection can occur, or [Line
Calculate the intersection point between two lines.Parameters:
- line [Line] — the line to intersect with
Returns:
- [Point] the intersection point, or nil if no intersection can occur, or [Line] — self if the lines coincide
length → Number
Return the length of the line segment.Returns:
- [Number] — the length of the line segment
point_at_dx(dx) → Point] the intersection point, or nil if no intersection can occur, or [Line
Calculate the intersection point on a line where the point is some horizontal distance from the reference point.Parameters:
- dx [Numeric] — the horizontal delta distance
Returns:
- [Point] the intersection point, or nil if no intersection can occur, or [Line] — self if the lines coincide
point_at_dy(dy) → Point] the intersection point, or nil if no intersection can occur, or [Line
Calculate the intersection point on a line where the point is some vertical distance from the reference point.Parameters:
- dy [Numeric] — the vertical delta distance
Returns:
- [Point] the intersection point, or nil if no intersection can occur, or [Line] — self if the lines coincide
point_at_x(x) → Point] the intersection point, or nil if no intersection can occur, or [Line
Calculate the intersection point on a line where the point is at some specific horizontal location.Parameters:
- x [Numeric] — the x-coordinate
Returns:
- [Point] the intersection point, or nil if no intersection can occur, or [Line] — self if the lines coincide
point_at_y(y) → Point] the intersection point, or nil if no intersection can occur, or [Line
Calculate the intersection point on a line where the point is at some specific vertical location.Parameters:
- y [Numeric] — the y-coordinate
Returns:
- [Point] the intersection point, or nil if no intersection can occur, or [Line] — self if the lines coincide
split → Array<Line>
Create an array of two vectors from an infinite line.Returns:
- [Array<Line>] — the two new vectors
to_ary → Array<Numeric>
Array conversion method.Returns:
- [Array<Numeric>] — an array representation of the Line
to_s → String
String conversion method.Returns:
- [String] — a string representation of the Line
Class: Cartesia::Point
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/point.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all point-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(x, y)
The class initializer.Parameters:
- x [Numeric] — the x coordinate of the point
- y [Numeric] — the y coordinate of the point
Method Details
!=(point) → Boolean
Inequality comparison method.Parameters:
- point [Point] — the point to compare against
Returns:
- [Boolean] — true if the points are not at the same location
==(point) → Boolean
Equality comparison method.Parameters:
- point [Point] — the point to compare against
Returns:
- [Boolean] — true if the points are at the same location
bearing_from(point) → Angle
Calculate the bearing from another point to this point.Parameters:
- point [Point] — the point to measure against
Returns:
- [Angle] — the bearing from another point to this point
bearing_to(point) → Angle
Calculate the bearing from this point to another point.Parameters:
- point [Point] — the point to measure against
Returns:
- [Angle] — the bearing from this point to another point
distance_from(point) → Numeric
Calculate the distance between two points.Parameters:
- point [Point] — the point to measure against
Returns:
- [Numeric] — the distance between two points
dxy_to(point) → Array<Numeric>
Calculate the xy distance between two points.Parameters:
- point [Point] — the point to measure against
Returns:
- [Array<Numeric>] — the dx and dy distances between two points
move_to!(distance, bearing) → Point
Move this point to a new location based on distance and bearing.Parameters:
- distance [Numeric] — the distance to move the point
- bearing [Angle] — the bearing to move the point
Returns:
- [Point] — the current Point instance
new_point_from(distance, bearing) → Point
Create a new point based on this point moved to a new location based on distance and bearing.Parameters:
- distance [Numeric] — the distance to move the point
- bearing [Angle] — the bearing to move the point
Returns:
- [Point] — the created Point instance
new_point_rotated_from(point, angle) → Point
Create a new point rotated around an origin point by a bearing delta.Parameters:
- point [Point] — the point to move the current point around
- angle [Angle] — the delta bearing to rotate the point
Returns:
- [Point] — the created Point instance
new_point_using_dxy(dx, dy) → Point
Create a new point based on this point moved to a new location based on dx & dy distances.Parameters:
- dx [Numeric] — the distance to move the point along the x-axis
- dy [Numeric] — the distance to move the point along the y-axis
Returns:
- [Point] — the created Point instance
rotate_around!(point, angle) → Point
Rotate the point around an origin point by a bearing delta.Parameters:
- point [Point] — the point to move the current point around
- angle [Angle] — the delta bearing to rotate the point
Returns:
- [Point] — the current Point instance
set(x, y) → Point
Sets the Point location.Parameters:
- x [Numeric] — the x coordinate of the new location
- y [Numeric] — the y coordinate of the new location
Returns:
- [Point] — the current Point instance
to_ary → Array<Numeric>
Array conversion method.Returns:
- [Array<Numeric>] — an array representation of the Point
to_s → String
String conversion method.Returns:
- [String] — a string representation of the Point
Class: Cartesia::Polygon
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/cartesia/polygon.rb | Ruby | Kenneth F. Guerin | Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. Copyright © 2020-2022, Kenneth F. Guerin, all rights reserved. |
Overview
This class handles all polygon-based calculations.
Constructor Registry
Method Registry
Constructor Details
new(points)
Parameters:
- points [Array<Point>] — the points of the polygon
Method Details
append_point(point) → Polygon
Append a single point to the polygon.Parameters:
- point [Point] — the new point of the polygon
Returns:
- [Polygon] — the current Polygon instance
append_points(points) → Polygon
Append a set of points to the polygon.Parameters:
- points [Array<Point>] — the new points of the polygon
Returns:
- [Polygon] — the current Polygon instance
closest_intersection_point_from_point(point) → Point
Calculate the closest intersection point between a given point and the polygon.Parameters:
- point [Point] — the point to check against
Returns:
- [Point] — the point on the polygon closest to the given point
delete_point_at(index) → Polygon
Delete a single point within the polygon.Parameters:
- index [Integer] — the insertion point within the polygon point list
Returns:
- [Polygon] — the current Polygon instance
distance_from_point(point) → Numeric
Calculate the closest distance between a given point and the polygon.Parameters:
- point [Point] — the point to check against
Returns:
- [Numeric] — the closest distance between the polygon and the given point
gen_line_segments → Array<Line> <private>
Generate the line segments of a polygon from the given points.Returns:
- [Array<Line>] — the array of line segments
insert_point(point, index) → Polygon
Insert a single point within the polygon.Parameters:
- point [Point] — the new point of the polygon
- index [Integer] — the insertion point within the polygon point list
Returns:
- [Polygon] — the current Polygon instance
insert_points(points, index) → Polygon
Insert a set of points within the polygon.Parameters:
- points [Array<Point>] — the new points of the polygon
- index [Integer] — the insertion point within the polygon point list
Returns:
- [Polygon] — the current Polygon instance
is_point_inside?(point) → Boolean
Calculates whether a given point is within the area enclosed by a polygon.Parameters:
- point [Point] — the point to check
Returns:
- [Boolean] — true if the point is within the polygon area
pt_distance_info(point) → Array <private>
Calculate closest point and distance information between a point and the polygon.Parameters:
- point [Point] — the point to check
Returns:
- [Array] — a mixed type 2-element array containing the intersection point and the distance to it
to_s → String
String conversion method.Returns:
- [String] — the string representation of the polygon
Class: Cartesia
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/cartesia/singletons.c | CRuby | Kenneth F. Guerin | Copyright © 2020-2022 Kenneth F. Guerin, All rights reserved. |
Overview
Singleton Registry
Singleton Details
clamp_angle(radians) → Numeric
Parameters:
- radians [Numeric] — the angle measurement in radians
Returns:
- [Numeric] — the clamped angle measurement in radians
clamp_angle_to_pi(radians) → Numeric
Parameters:
- radians [Numeric] — the angle measurement in radians
Returns:
- [Numeric] — the clamped angle measurement in radians
d2r(d) → Numeric
Parameters:
- d [Numeric] — the angle measurement in degrees
Returns:
- [Numeric] — the angle measurement in radians
d2s(d) → Numeric
Parameters:
- d [Numeric] — the angle measurement in degrees
Returns:
- [Numeric] — the angle measurement in sectons
distance_from(pt1, pt2) → Array<Numeric>
Parameters:
- pt1 [Array<Numeric>] — the first point, defined as a 2-dimensional array of coordinate points (x,y)
- pt2 [Array<Numeric>] — the second point, defined as a 2-dimensional array of coordinate points (x,y)
Returns:
- [Array<Numeric>] — the distance between the two points
dxybearing(dx, dy) → Numeric
Parameters:
- dx [Numeric] — the x-coordinate distance between two points
- dy [Numeric] — the y-coordinate distance between two points
Returns:
- [Numeric] — the angle from one point to the next measured in radians
dxydab(dx, dy) → Array<Numeric>
Parameters:
- dx [Numeric] — the x-coordinate distance between two points
- dy [Numeric] — the y-coordinate distance between two points
Returns:
- [Array<Numeric>] — the 2-dimensional array containing the distance and bearing between the two points
dxydistance(dx, dy) → Numeric
Parameters:
- dx [Numeric] — the x-coordinate distance between two points
- dy [Numeric] — the y-coordinate distance between two points
Returns:
- [Numeric] — the distance between the two points
r2d(r) → Numeric
Parameters:
- r [Numeric] — the angle measurement in radians
Returns:
- [Numeric] — the angle measurement in degrees
r2s(r) → Numeric
Parameters:
- r [Numeric] — the angle measurement in radians
Returns:
- [Numeric] — the angle measurement in sectons
s2d(s) → Numeric
Parameters:
- s [Numeric] — the angle measurement in sectons
Returns:
- [Numeric] — the angle measurement in degrees
s2r(s) → Numeric
Parameters:
- s [Numeric] — the angle measurement in sectons
Returns:
- [Numeric] — the angle measurement in radians
The Cartesia Geometry Toolkit
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| angle.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| arc.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| bezier.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| cartesia.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| catenary.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| chainwrap.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| circle.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| hexCoordinateSystem.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| hexGeometry.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| hexMapInfo.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| line.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| point.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| polygon.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Contents Directory
Namespace: Cartesia
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| angle.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| arc.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| bezier.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| cartesia.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| catenary.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| chainwrap.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| circle.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| hexCoordinateSystem.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| hexGeometry.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| hexMapInfo.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| line.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| point.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| polygon.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
The Cartesia namespace encapsulates all definitions related to the family of Cartesia classes.
The Cartesia library is a library which handles 2d geometry calculations with some functions operating on individual numbers and some functionality encapsulated within object classes.
Constant Registry
Function Registry
Constant Details
Cartesia.CCW <read-only>
Cartesia.CCWCCW <read-only>
Cartesia.CCWCW <read-only>
Cartesia.CUBIC <read-only>
Cartesia.CW <read-only>
Cartesia.CWCCW <read-only>
Cartesia.CWCW <read-only>
Cartesia.DEGREES <read-only>
Cartesia.INFINITE <read-only>
Cartesia.INSIDE <read-only>
Cartesia.LINE_INFINITE <read-only>
Cartesia.LINE_SEGMENT <read-only>
Cartesia.LINE_VECTOR <read-only>
Cartesia.OUTSIDE <read-only>
Cartesia.QUADRATIC <read-only>
Cartesia.RAD0 <read-only>
Cartesia.RAD180 <read-only>
Cartesia.RAD270 <read-only>
Cartesia.RAD360 <read-only>
Cartesia.RAD45 <read-only>
Cartesia.RAD90 <read-only>
Cartesia.RADIANS <read-only>
Cartesia.SEC0 <read-only>
Cartesia.SEC180 <read-only>
Cartesia.SEC270 <read-only>
Cartesia.SEC360 <read-only>
Cartesia.SEC45 <read-only>
Cartesia.SEC90 <read-only>
Cartesia.SECTONS <read-only>
Cartesia.TALL <read-only>
Cartesia.WIDE <read-only>
Function Details
Cartesia.bearingFrom(ax, ay, bx, by) → Number
This function computes the distance & bearing (angle) between two points given their x,y coordinates.Parameters:
- ax [Number] — the x-coordinate of the first point
- ay [Number] — the y-coordinate of the first point
- bx [Number] — the x-coordinate of the second point
- by [Number] — the y-coordinate of the second point
Returns:
- [Number] — the bearing between the two points in radians
Cartesia.bezierCurveLength(bezier) → Number
This function returns the length of the bezier curve.Parameters:
- bezier [Object or Array<Number>] — the bezier curve representation
Returns:
- [Number] — the bezier curve length
Cartesia.bezierGetEPoints(intervals, bezier, callback) → Array<Number>
This function returns a list of evenly-spaced points along a bezier curve or calls a procedure for each point calculated. The callback's parameters are (nth,value) where nth is the index of the point and the value is the coordinate pair of the point.Parameters:
- intervals [Integer] — the number of points to return
- bezier [Object or Array<Number>] — the bezier curve representation
- callback [Function] — a function to call as each point is calculated <default: null>
Returns:
- [Array<Number>] — the coordinates of each point as a coordinate list, if no callback was specified
Cartesia.bezierGetTPoints(intervals, bezier, callback) → Array<Number>
This function returns a list of timed points along a bezier curve or calls a procedure for each point calculated. The callback's parameters are (nth,value) where nth is the index of the point and the value is the coordinate pair of the point.Parameters:
- intervals [Integer] — the number of points to return
- bezier [Object or Array<Number>] — the bezier curve representation
- callback [Function] — a function to call as each point is calculated <default: null>
Returns:
- [Array<Number>] — the coordinates of each point as a coordinate list, if no callback was specified
Cartesia.bezierHullLength(bezier) → Number
This function returns the hull length of the bezier curve.Parameters:
- bezier [Object or Array<Number>] — the bezier curve representation
Returns:
- [Number] — the hull length of the bezier curve
Cartesia.chordAngle(radius, length) → Number
This function calculates the angle of a chord of a given length of a circle of a given radius.Parameters:
- radius [Number] — the radius of the circle
- length [Number] — the length of the chord
Returns:
- [Number] — the angle of the chord in radians
Cartesia.chordLength(radius, angle) → Number
This function calculates the chord length of a circle of a given radius and angle between two points on the circle.Parameters:
- radius [Number] — the radius of the circle
- angle [Number] — the angle, in radians, between two points on the circle
Returns:
- [Number] — the length of the chord
Cartesia.clampAngle(radians) → Number
This function ensures a radian angle measurement will be between 0° and 360°.Parameters:
- radians [Number] — the angle measurement in radians
Returns:
- [Number] — the angle measurement in radians clamped between 0 and 2π
Cartesia.clampAngleToPI(radians) → Number
This function ensures a radian angle measurement will be between -180° and 180°.Parameters:
- radians [Number] — the angle measurement in radians
Returns:
- [Number] — the angle measurement in radians clamped between -π and π
Cartesia.cp2pt(cp) → Cartesia.Point
This function creates a Cartesia.Point object from a coordinate pair.Parameters:
- cp [Array<Number>] — the 2-element coordinate pair
Returns:
- [Cartesia.Point] — the Cartesia.Point object
Cartesia.cpv2pts(cpv) → Array<Cartesia.Point> or Null
This function creates an array of Cartesia.Point objects from an array of coordinates.Parameters:
- cpv [Array<Number>] — the even-sized array of coordinates
Returns:
- [Array<Cartesia.Point> or Null] — the array of Cartesia.Point objects
Cartesia.d2angle(d) → Cartesia.Angle
This function creates a Cartesia.Angle object with a size in degrees.Parameters:
- d [Number] — the size of the angle in degrees
Returns:
- [Cartesia.Angle] — the Cartesia.Angle object
Cartesia.d2r(r) → Number
This function converts degrees to radians.Parameters:
- r [Number] — the angle measurement in degrees
Returns:
- [Number] — the angle measurement in radians
Cartesia.d2s(r) → Number
This function converts degrees to sectons.Parameters:
- r [Number] — the angle measurement in degrees
Returns:
- [Number] — the angle measurement in sectons
Cartesia.dabFrom(ax, ay, bx, by) → Array<Number>
This function computes the bearing (angle) between two points given their x,y coordinates.Parameters:
- ax [Number] — the x-coordinate of the first point
- ay [Number] — the y-coordinate of the first point
- bx [Number] — the x-coordinate of the second point
- by [Number] — the y-coordinate of the second point
Returns:
- [Array<Number>] — the distance & bearing between the two points, the latter in radians
Cartesia.distanceFrom(ax, ay, bx, by) → Number
This function computes the distance between two points given their x,y coordinates.Parameters:
- ax [Number] — the x-coordinate of the first point
- ay [Number] — the y-coordinate of the first point
- bx [Number] — the x-coordinate of the second point
- by [Number] — the y-coordinate of the second point
Returns:
- [Number] — the direct distance between two points
Cartesia.dxyBearing(dx, dy) → Number
This function computes the bearing (angle) between two points given their dx and dy distances.Parameters:
- dx [Number] — the x-axis distance between two points
- dy [Number] — the y-axis distance between two points
Returns:
- [Number] — the bearing between the two points in radians
Cartesia.dxyDAB(dx, dy) → Array<Number>
This function computes the distance & bearing (angle) between two points given their dx and dy distances.Parameters:
- dx [Number] — the x-axis distance between two points
- dy [Number] — the y-axis distance between two points
Returns:
- [Array<Number>] — the distance & bearing between the two points, the latter in radians
Cartesia.dxyDistance(dx, dy) → Number
This function computes the distance between two points given their dx and dy distances.Parameters:
- dx [Number] — the x-axis distance between two points
- dy [Number] — the y-axis distance between two points
Returns:
- [Number] — the direct distance between two points
Cartesia.ensureAngle(angle) → Cartesia.Angle ⇏ ArgumentError
This function is used throughout Cartesia to normalize angle representations to Cartesia.Angle object(s).Parameters:
- angle [Cartesia.Angle or Number] — the angle argument as a Cartesia.Angle object or a measurement in radians
Returns:
- [Cartesia.Angle] — the Cartesia.Angle object to work on
Throws:
- [ArgumentError] — if the angle representation is invalid.
Cartesia.ensurePoint(point) → Cartesia.Point ⇏ ArgumentError
This function is used throughout Cartesia to normalize point representations to Cartesia.Point object(s).Parameters:
- point [Variadic] — a point representation (see Cartesia.Point documentation)
Returns:
- [Cartesia.Point] — the Cartesia.Point object to work on
Throws:
- [ArgumentError] — if the point representation is invalid.
Cartesia.ensurePoints(pt) → Array<Cartesia.Point> ⇏ ArgumentError
This function is used throughout Cartesia to normalize multiple point representations to Cartesia.Point object(s).Parameters:
- pt [Array<Cartesia.Point> or Array<Number>] — the points argument as an array of Cartesia.Points or as an even-length array of coordinates
Returns:
- [Array<Cartesia.Point>] — the Cartesia.Point objects to work on
Throws:
- [ArgumentError] — if the points representation is invalid.
Cartesia.findCircleArcOrigin(r, x1, y1, x2, y2, large_arc_flag, sweep_flag) → Array<Number>
This function calculates the origin of a circle given an arc described using endpoints, the circle's radius, whether it's a large arc and its sweep direction.Parameters:
- r [Number] — the radius of the circle
- x1 [Number] — the x-coordinate of the first end point
- y1 [Number] — the y-coordinate of the first end point
- x2 [Number] — the x-coordinate of the second end point
- y2 [Number] — the y-coordinate of the second end point
- large_arc_flag [Boolean] — true, if the arc goes "the long way around" between the two end points
- sweep_flag [Boolean] — true, if the arc direction is counter-clockwise
Returns:
- [Array<Number>] — the x,y coordinates of the circle's origin
Cartesia.getOrbitPoints(radius, n, cx, cy, first_angle)
This function calculates equidistant points along a circular path at a given radius and number of pointsParameters:
- radius [Number] — the radius of the circle
- n [Number] — the number of equidistant points to calculate
- cx [Number] — the x-coordinate of the center or origin point
- cy [Number] — the y-coordinate of the center or origin point
- first_angle [Number] — the starting angle
Cartesia.getPointCoords(point) → Array<Number> ⇏ ArgumentError
This function is used to get x,y coordinates regardless of point representation.Parameters:
- point [Variadic] — a point representation (see Cartesia.Point documentation)
Returns:
- [Array<Number>] — an array containing the x,y coordinates
Throws:
- [ArgumentError] — if the point representation is invalid or unrecognized
Cartesia.getRadialPoints(radius, angles, cx, cy) ⇏ ArgumentError
This function calculates points along a circlar path at a given radius and at given anglesParameters:
- radius [Number] — the radius of the circle
- angles [Array<Number>] — the angles from the origin point where the points are to be calculated
- cx [Number] — the x-coordinate of the center or origin point
- cy [Number] — the y-coordinate of the center or origin point
Throws:
- [ArgumentError] — if the angles representation is invalid or unrecognized
Cartesia.getRadians(angle) → Number ⇏ ArgumentError
This function gets a radian measurement from a variety of angle representations.Parameters:
- angle [Variadic] — the angle representation (see Cartesia.Angle documentation)
Returns:
- [Number] — the radian measurement of the angle
Throws:
- [ArgumentError] — if the angle representation is invalid or unrecognized
Cartesia.getSpokePoints(radius, n, width, cx, cy, first_angle)
This function calculates points along a circular path at a given radius and number of spokes and width of each spokeParameters:
- radius [Number] — the radius of the circle
- n [Number] — the number of equidistant points to calculate to pin the center of each spoke
- width [Number] — the width of each spoke
- cx [Number] — the x-coordinate of the center or origin point
- cy [Number] — the y-coordinate of the center or origin point
- first_angle [Number] — the starting angle
Cartesia.newLineSegment(reference, endpt) → Cartesia.Line
This function creates a new Cartesia.Line object which is a line segment composed of two points.Parameters:
- reference [Cartesia.Point] — the starting point of the line segment
- endpt [Cartesia.Point] — the end point of the line segment
Returns:
- [Cartesia.Line] — the Cartesia.Line object
Cartesia.newRect(point, width, height) → Cartesia.Polygon
This function creates a new Cartesia.Polygon object which is a rectangle of a given size.Parameters:
- point [Cartesia.Point] — the location of the rectangle
- width [Number] — the width of the rectangle
- height [Number] — the height of the rectangle
Returns:
- [Cartesia.Polygon] — the Cartesia.Polygon object
Cartesia.newSquare(point, size) → Cartesia.Polygon
This function creates a new Cartesia.Polygon object which is a square of a given size.Parameters:
- point [Cartesia.Point] — the location of the square
- size [Number] — the size of the square
Returns:
- [Cartesia.Polygon] — the Cartesia.Polygon object
Cartesia.pointBetween(ax, ay, bx, by, ratio) → Array<Number>
This function computes the location of a point which is a proportional distance between the two given points.Parameters:
- ax [Number] — the x-coordinate of the first point
- ay [Number] — the y-coordinate of the first point
- bx [Number] — the x-coordinate of the second point
- by [Number] — the y-coordinate of the second point
- ratio [Number] — the percentage, as a value from 0.0 to 1.0, from the first point along a line to the second point <default: 0.5>
Returns:
- [Array<Number>] — the x,y coordinates of the point in between
Cartesia.pointFrom(x, y, d, b) → Array<Number>
This function computes the point which is a distance and bearing from the given point, given its x,y coordinates.Parameters:
- x [Number] — the x-coordinate of the point
- y [Number] — the y-coordinate of the point
- d [Number] — the distance the second point will be from the given point
- b [Number] — the bearing, in radians, the second point will be from the given point
Returns:
- [Array<Number>] — the x,y coordinates of the second point
Cartesia.r2angle(r) → Cartesia.Angle
This function is used throughout Cartesia to normalize angle representations to Cartesia.Angle object(s).Parameters:
- r [Number] — the size of the angle in radians
Returns:
- [Cartesia.Angle] — the Cartesia.Angle object
Cartesia.r2d(r) → Number
This function converts radians to degrees.Parameters:
- r [Number] — the angle measurement in radians
Returns:
- [Number] — the angle measurement in degrees
Cartesia.r2s(r) → Number
This function converts radians to sectons.Parameters:
- r [Number] — the angle measurement in radians
Returns:
- [Number] — the angle measurement in sectons
Cartesia.rotatedPointFrom(ax, ay, bx, by, db) → Array<Number>
This function computes the location of a point which is a distance and bearing from the first point and based on a second point moving radially by a given angle.Parameters:
- ax [Number] — the x-coordinate of the first point
- ay [Number] — the y-coordinate of the first point
- bx [Number] — the x-coordinate of the second point
- by [Number] — the y-coordinate of the second point
- db [Number] — the delta angular measurement, in radians
Returns:
- [Array<Number>] — the x,y coordinates of the third point
Cartesia.s2angle(s) → Cartesia.Angle
This function creates a Cartesia.Angle object with a size in sectons.Parameters:
- s [Number] — the size of the angle in sectons
Returns:
- [Cartesia.Angle] — the Cartesia.Angle object
Cartesia.s2d(s) → Number
This function converts sectons to degrees.Parameters:
- s [Number] — the angle measurement in sectons
Returns:
- [Number] — the angle measurement in degrees
Cartesia.s2r(s) → Number
This function converts sectons to radians.Parameters:
- s [Number] — the angle measurement in sectons
Returns:
- [Number] — the angle measurement in radians
Cartesia.u2r(m, uom) → Number ⇏ ArgumentError
This function converts a given angular measurement into radians.Parameters:
- m [Number] — the number of units
- uom [Symbol] — one of { Cartesia.RADIANS,Cartesia.DEGREES,Cartesia,SECTONS } <default: Cartesia.RADIANS>
Returns:
- [Number] — the angular measurement in radians
Throws:
- [ArgumentError] — if the unit of measurement is unrecognized
Cartesia.xy2pt(x, y) → Cartesia.Point
This function creates a Cartesia.Point object from x,y coordinates.Parameters:
- x [Number] — the x-coordinate of the point
- y [Number] — the y-coordinate of the point
Returns:
- [Cartesia.Point] — the Cartesia.Point object
Class: Cartesia.Angle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| angle.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all angle-based calculations, including units of measure conversions.
Angle Representations
Raw angle representations used to create and/or operate on this class can come in many forms:- Cartesia.Angle
- a 1-element or 2-element array of numerical units and an optional unit of measurement type
- numerical units and an optional unit of measurement type as separate arguments
This multitude of representations leads to the use of variadic arguments for the functions.
Sectons
One unique aspect of the library is an angle unit of measurement called a secton. Whereas radians use floating point numbers between 0 and 2π and degrees use numbers between 0 and 360, and can be integers or floating point, the secton is designed to be an integral unit between 0 and 64800. The upper limit was designed to fit within a 16-bit integer. One secton equals 1/180° and has a good enough granularity for most digital graphics applications.Constructor Registry
Property Registry
Method Registry
Constructor Details
new Cartesia.Angle(angle)
Parameters:
- angle [Variadic] — the initial value of the angle <default: 0.0>
Property Details
degrees
sections
Method Details
add(angle) → Cartesia.Angle
This method creates a new Cartesia.Angle by adding another angle to this angle.Parameters:
- angle [Variadic] — the initial value of the angle <default: 0.0>
Returns:
- [Cartesia.Angle] — a new Cartesia.Angle object
add$(angle) → Cartesia.Angle
This method adds an angle to this one.Parameters:
- angle [Variadic] — the initial value of the angle <default: 0.0>
Returns:
- [Cartesia.Angle] — itself
clone() → Cartesia.Angle
This function returns a new Cartesia.Angle with the same values.Returns:
- [Cartesia.Angle] — the new Cartesia.Angle object
delta() → Cartesia.Angle
This method creates a new Cartesia.Angle which contains an angle which is represented as a difference measurement.Returns:
- [Cartesia.Angle] — the new Cartesia.Angle object
delta$() → Cartesia.Angle
This method ensures that the angle is represented as a difference measurement.Returns:
- [Cartesia.Angle] — itself
difference(angle) → Number
This method calculates the difference between this angle and another one, in radians.Parameters:
- angle [Variadic] — the initial value of the angle <default: 0.0>
Returns:
- [Number] — the difference between the two angles
reflectAroundPI() → Cartesia.Angle
This method creates a new Cartesia.Angle which contains an angle which is a reflection between 0° and 180°.Returns:
- [Cartesia.Angle] — the new Cartesia.Angle object
reflectAroundPI$() → Cartesia.Angle
This method ensures that the angle is reflection between 0° and 180°.Returns:
- [Cartesia.Angle] — itself
reflectTowardZero() → Cartesia.Angle
This method creates a new Cartesia.Angle which contains an angle which is a reflection between 270° and 90° toward 0°.Returns:
- [Cartesia.Angle] — the new Cartesia.Angle object
reflectTowardZero$() → Cartesia.Angle
This method ensures that the angle is reflected between 270° and 90° toward 0°.Returns:
- [Cartesia.Angle] — itself
set(angle) → Cartesia.Angle
This method sets the angle's value.Parameters:
- angle [Variadic] — the value of the angle to set <default: 0.0>
Returns:
- [Cartesia.Angle] — itself
toString() → String
This method returns a string representation of the angle.Returns:
- [String] — the string representation
valueOf() → Number
This method returns the numerical value of the angle, in radians.Returns:
- [Number] — the value of the angle, in radians
Class: Cartesia.Arc ← Cartesia.Circle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| arc.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all arc-based calculations.
Constructor Registry
Method Registry
Constructor Details
new Cartesia.Arc(center, radius, bearing_slice) ⇏ ArgumentError
Parameters:
- center [Number] — the center point location of the arc
- radius [Number] — the radius of the circle of which the arc is a subset
- bearing_slice [Array<Cartesia.Angle>] — the two angles that mark the end points of the arc
Throws:
- [ArgumentError] — if the bearing angle is invalid or unrecognized
Method Details
intersectionWithArc(arc) → Array<Cartesia.Point> or Symbol
This method determines the the intersection points between the arc and a given arc.Parameters:
- arc [Cartesia.Circle] — the arc this arc will intersect with
Returns:
- [Array<Cartesia.Point> or Symbol] — the array of points where the arc intersects with this arc or a symbol denoting whether the arc is outside of this arc
intersectionWithCircle(circle) → Array<Cartesia.Point> or Symbol
This method determines the the intersection points between this arc and a given circle.Parameters:
- circle [Cartesia.Circle] — the circle this arc will intersect with
Returns:
- [Array<Cartesia.Point> or Symbol] — the array of points where the circle intersects with this arc or a symbol denoting whether the circle is outside of this arc
intersectionWithLine(line) → Array<Cartesia.Point> or Symbol ⇏ ArgumentError
This method determines the points on an arc which intersect with the given line.Parameters:
- line [Cartesia.Line] — the line this arc will intersect with
Returns:
- [Array<Cartesia.Point> or Symbol] — the array of points where the line intersects with this arc or a symbol denoting whether the line is outside of this arc
Throws:
- [ArgumentError] — if the line is invalid
toString() → String
This method returns a string representation of the arc.Returns:
- [String] — the string representation
Class: Cartesia.Bezier
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| bezier.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all bezier-based calculations.
Constructor Registry
Property Registry
Method Registry
Constructor Details
new Cartesia.Bezier(points) ⇏ ArgumentError
Parameters:
- points [Array<Cartesia.Point>] — the 3 points of a quadratic or the 4 points of a cubic bezier curve
Throws:
- [ArgumentError] — if the points are invalid or unrecognizable
Property Details
length
Method Details
ePoints(intervals, callback) → Array<Cartesia.Point>
This method either returns a list of equidistant-points or calls a procedure for each equidistant-point.Parameters:
- intervals [Integer] — the number of equidistant points along the curve to collect, visit
- callback [Function] — the callback function to call for each equidistant point <default: null>
Returns:
- [Array<Cartesia.Point>] — if the equidistant points are being collected
isValid() → Boolean
This method determines if the bezier contains valid informationReturns:
- [Boolean] — true, if the type is Cartesia.QUADRATIC or Cartesia.CUBIC
tPoints(intervals, callback) → Array<Cartesia.Point>
This method either returns a list of time-points or calls a procedure for each time-point.Parameters:
- intervals [Integer] — the number of time points along the curve to collect, visit
- callback [Function] — the callback function to call for each time point <default: null>
Returns:
- [Array<Cartesia.Point>] — if the time points are being collected
Class: Cartesia.Catenary
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| catenary.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all catenary-based calculations. The how-to of catenary curve mathematics will be added later.
Constructor Registry
Property Registry
Method Registry
Constructor Details
new Cartesia.Catenary(definition)
This constructor will define a catenary curve based on a factor a, where y = a at x = 0, if a chain will drop to its lowest point at x = 0. The equation y = a cosh(x/a) defines the curve. The factor 'a', can be explictly given or it can be derived from dx, dy and/or phi values. Only two of the three values of dx, dy or phi need be supplied to calculate 'a'.Parameters:
- definition [Object] — the parameters of the catenary curve
- a [Cartesia.Point] — the anchor point
- dx [Number] — the x-axis distance between the anchor point and the lowest point of the curve
- dy [Number] — the y-axis distance between the anchor point and the lowest point of the curve
- phi [Number] — the angle of descent from the anchor point
Property Details
isTracking
Method Details
$calcAGivenDXPhi(dx, phi) → Number <private>
This private method calculates 'a' based on the given dx and phi parameters.Parameters:
- dx [Number] — the x-axis distance between the curve's anchor point and its end point
- phi [Number] — the curve's angle of departure from the anchor point
Returns:
- [Number] — the curve's a factor
$calcAGivenDyPhi(dy, phi) → Number <private>
This private method calculates 'a' based on the given dy and phi parameters.Parameters:
- dy [Number] — the y-axis distance between the curve's anchor point and its end point
- phi [Number] — the curve's angle of departure from the anchor point
Returns:
- [Number] — the curve's a factor
$calcAGivenDydx(dy, dx, prec) → Number <private>
This private method calculates 'a' based on the given dx and dy parameters.Parameters:
- dy [Number] — the y-axis distance between the curve's anchor point and its end point
- dx [Number] — the x-axis distance between the curve's anchor point and its end point
- prec [Number] — the calculation precision <default: 10>
Returns:
- [Number] — the curve's a factor
$ctTrackPoint(is_first, pt, distance, precision) → Cartesia.Point <private>
This private method calculates the curve tracking points based on the procedure's current stateParameters:
- is_first [Boolean] — true, if we are calculating the first point
- pt [Cartesia.Point] — the point we are calculating from
- distance [Number] — the distance away from the given point we are calculating for
- precision [Number] — the level of precision we are limiting the calculations to <default: Cartesia.CatenaryPrecision>
Returns:
- [Cartesia.Point] — the next point on the curve
ctFirst(point, distance_from) → Cartesia.Point ⇏ Error
This method gets the first point in the curve tracking operation.Parameters:
- point [Cartesia.Point] — a starting point not part of the curve <default: null>
- distance_from [Number] — a distance from the specified point <default: null>
Returns:
- [Cartesia.Point] — the first point in the curve
Throws:
- [Error] — if the operation has not been started
ctNext(distance_from) → Cartesia.Point ⇏ Error
This method gets the next point in the curve tracking operation.Parameters:
- distance_from [Number] — a distance from the current point <default: null>
Returns:
- [Cartesia.Point] — the next point in the curve
Throws:
- [Error] — if the operation has not been started
dxAtDY(dy) → Number
This method returns the dx value at a point dy from the anchor point.Parameters:
- dy [Number] — the dy value
Returns:
- [Number] — the dx value
dyAtDX(dx) → Number
This method returns the dy value at a point dx from the anchor point.Parameters:
- dx [Number] — the dx value
Returns:
- [Number] — the dy value
finishCurveTracking()
This method ends the current curve tracking operation.phiAtDX(dx) → Number
This method returns the phi value at a point dx from the anchor point.Parameters:
- dx [Number] — the dx value
Returns:
- [Number] — the phi value
phiAtDY(dy) → Number
This method returns the phi value at a point dy from the anchor point.Parameters:
- dy [Number] — the dy value
Returns:
- [Number] — the phi value
sAtDX(dx) → Number
This method returns the s value at a point dx from the anchor point.Parameters:
- dx [Number] — the dx value
Returns:
- [Number] — the s value
sAtDY(dy) → Number
This method returns the s value at a point dy from the anchor point.Parameters:
- dy [Number] — the dy value
Returns:
- [Number] — the s value
startCurveTracking(anchor, dx, style, direction)
This method starts an iterative curve tracking operation between an anchor point and the end point.Parameters:
- anchor [Cartesia.Point] — the anchor point of the curve
- dx [Number] — the dx distance
- style [Symbol] — the tracking methodology: { Cartesia.ByPX, Cartesia.ByNX, Cartesia.ByInvPX, Cartesia.ByInvNX }
- direction [Symbol] — the direction of the tracking: { Cartesia.A2E, Cartesia.E2A }
toString() → String
This method returns a string representation of the catenary curve object.Returns:
- [String] — the string representation
Class: Cartesia.ChainWrap
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| chainwrap.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all chain-wrap-based calculations.
Constructor Registry
Property Registry
Method Registry
Constructor Details
new Cartesia.ChainWrap(bogies, style, link_properties, offset, catgrav_hints) ⇏ ArgumentError ⇏ Error
Parameters:
- bogies [Array<Object>] — the bogies of the tank tread
- type [Symbol] — the type of bogie: { Cartesia.DRIVE_BOGIE, Cartesia.ROAD_BOGIE, Cartesia.TOP_BOGIE, Cartesia.REAR_BOGIE, Cartesia.TENSION_BOGIE }
- cx [Number] — the x-coordinate of the center of the bogie
- cy [Number] — the y-coordinate of the center of the bogie
- r [Number] — the radius of the center of the bogie
- style [Symbol] — the style of chain wrapping: { Cartesia.TAUT, Cartesia.CATGRAV }
- link_properties [Object] — the properties of each link in the chain, tank tread
- thickness [Number] — the thickness of the link
- length [Number] — the length of the link <default: null>
- offset [Array<Number>] — <default: [ 0,0 ]>
- catgrav_hints [Object] — , if using Cartesia.CATGRAV style <default: null>
Throws:
- [ArgumentError] — if the style, link_properties or catgrav_hints are invalid or unrecognizable
- [Error] — if the link length is not given and cannot be calculated
Property Details
pathinfo
Method Details
$calcLinkLength(links_per_tooth) → Number <private>
This private method determines the size of the link based on the size of the drive bogie and the number of links/tooth.Parameters:
- links_per_tooth [Integer] — the number of links per tooth <default: 1>
Returns:
- [Number] — the link length
$makeCircleFromBogie(bogie) → Cartesia.Circle <private>
This private method make a circle for a particular bogie based on the bogie's size and location and the overall offset and chain link size.Parameters:
- bogie [Object] — the specified bogie
Returns:
- [Cartesia.Circle] — a circle describing the bogie
harvest(dbo) → Array<Cartesia.Point>
This method collects all of the points of the wrapped chain path around the bogies.Parameters:
- dbo [Integer] — <default: 50>
Returns:
- [Array<Cartesia.Point>] — the collections of points making up the wrapped chain path
Class: Cartesia.Circle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| circle.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all circle-based calculations.
Constructor Registry
Method Registry
Constructor Details
new Cartesia.Circle(center, radius)
Parameters:
- center [Cartesia.Point] — the location of the center point of the circle
- radius [Number] — the radius of the circle
Method Details
boundingBox() → Cartesia.Polygon
This method returns the bounding box of the circle.Returns:
- [Cartesia.Polygon] — the square which makes up the circle's bounding box
clone() → Cartesia.Circle
This method creates a new circle identical to this one.Returns:
- [Cartesia.Circle] — the new circle
closestIntersectionPointFromPoint(point) → Cartesia.Point
This method determines the point on the circle which is closest to the specified point.Parameters:
- point [Variadic] — the specified point
Returns:
- [Cartesia.Point] — the point on the circle closest to the specified point
distanceFromPoint(point) → Number
This method determines the distance from the point on the circle which is closest to the specified point.Parameters:
- point [Variadic] — the specified point
Returns:
- [Number] — the distance between the point on the circle closest to the specified point
getChordAngleByLength(length) → Cartesia.Angle
This method returns the angle of the circle's chord as defined by its length.Parameters:
- length [Number] — the chord length
Returns:
- [Cartesia.Angle] — the angle of the chord
getChordLengthByAngle(angle) → Number
This method returns the length of the circle's chord based on the angle separating the points from the center point.Parameters:
- angle [Cartesia.Angle] — the angle separating the points and determining the chord's length
Returns:
- [Number] — the length of the chord
getChordLengthByNSegs(nsegs) → Number
This method returns the length of the circle's chord based a number of equidistant chords running around the circle.Parameters:
- nsegs [Integer] — the number of segments used to define the size of each equidistant chord
Returns:
- [Number] — the length of the chord
getChordPointsByLength(length, direction, first_angle) → Array<Cartesia.Point>
This method returns the points on the circle which are a given chord lengthParameters:
- length [Number] — the chord length
- direction [Symbol] — the direction around the circle to travel <default: Cartesia.CW>
- first_angle [Variadic] — the angle from center where the first point will be located <default: 0.0>
Returns:
- [Array<Cartesia.Point>] — the calculated chord points around the circle
getChordPointsByN(npts, first_angle) → Array<Cartesia.Point> ⇏ ArgumentError
This method returns N points on a circle where they are equidistant from each other.Parameters:
- npts [Integer] — the number of points to get
- first_angle [Cartesia.Angle] — the first angle where the first point will be <default: 0.0>
Returns:
- [Array<Cartesia.Point>] — the chord points on the circle
Throws:
- [ArgumentError] — if the specified angle is invalid or unrecognized
getPoint(angle) → Cartesia.Point
This method returns the point at the specified angle from the circle's center.Parameters:
- angle [Cartesia.Angle] — the angle from the circle's center point
Returns:
- [Cartesia.Point] — the point on the circle at the specified angle from the center point
getTangentLineBetweenCircles(circle, connection) → Array<Cartesia.Line>
This method calculates the tangent lines between two circles based on rotation directions around the circles.Parameters:
- circle [Cartesia.Circle] — the second circle the tangent lines will connect with
- connection [Symbol] — the rotation directions around the two circles
Returns:
- [Array<Cartesia.Line>] — the two tangential lines connecting the two circles
getTangentVectors(bearing) → Array<Cartesia.Line>
This method returns the two tangential lines at a point on the circle bearing at an angle from the center point.Parameters:
- bearing [Cartesia.Angle] — the bearing from center
Returns:
- [Array<Cartesia.Line>] — the two tangential lines emanating from the chosen point
intersectionWithCircle(circle) → Array<Cartesia.Point> or Symbol ⇏ ArgumentError
This method determines the intersection points between a circle and another circle.Parameters:
- circle [Cartesia.Circle] — the circle the circle will intersect with
Returns:
- [Array<Cartesia.Point> or Symbol] — the array of points where the line intersects with the circle or a symbol denoting whether the circle is inside or outside or on top of the circle
Throws:
- [ArgumentError] — if the circle is invalid
intersectionWithLine(line) → Array<Cartesia.Point> or Symbol ⇏ ArgumentError
This method determines the intersection points between a circle and a line.Parameters:
- line [Cartesia.Line] — the line the circle will intersect with
Returns:
- [Array<Cartesia.Point> or Symbol] — the array of points where the line intersects with the circle or a symbol denoting whether the line is inside or outside of the circle
Throws:
- [ArgumentError] — if the line is invalid
isPointInside(point) → Boolean
This method is used to determine if a given point is inside the circle.Parameters:
- point [Variadic] — the specified point
Returns:
- [Boolean] — true, if the point is inside the circle
toString() → String
This method returns a string representation of the circle.Returns:
- [String] — the string representation
Class: Cartesia.HexCoordinateSystem
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| hexCoordinateSystem.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all hex coordinate system operations.
Constructor Registry
Method Registry
Constructor Details
new Cartesia.HexCoordinateSystem(cpoint, size, granularity, orientation) ⇏ ArgumentError
Parameters:
- cpoint [Cartesia.Point] — the location of the center of the hexagon on the mapped surface
- size [Number] — the edge-to-edge size of the hexagon
- granularity [Number] — the spacing between points within the hexagon
- orientation [Cartesia.WIDE or Cartesia.TALL] — the orientation of the hexagon <default: Cartesia.WIDE>
Throws:
- [ArgumentError] — if the orientation is invalid or unrecognized
Method Details
$coordDelta(e, v, constrain) → Array<Number> <private>
This private method converts the HCS coordinates to outside coordinates.Parameters:
- e [Integer] — the coordinate point along the e-axis
- v [Integer] — the coordinate point along the v-axis
- constrain [Boolean] — whether the given point should be constrained within the hexagon
Returns:
- [Array<Number>] — the mapped coordinate from the HCS coordinate system to the outside coordinate system
$isConstrained(e, v) → Boolean <private>
This private method determines if the given point, in e,v notation, is within the hexagon given the user space coordinate limits.Parameters:
- e [Integer] — the coordinate point along the e-axis
- v [Integer] — the coordinate point along the v-axis
Returns:
- [Boolean] — true if the given point is within the hexagon
coordsAt(point, constrain) → Cartesia.Point
This method converts the hex coordinate point to the user space point.Parameters:
- point [Variadic] — the point in the hex coordinate system
- constrain [Boolean] — true, if conversions outside of the hexagon are not allowed <default: true>
Returns:
- [Cartesia.Point] — the user space point
eachPoint(callback)
This method calls the supplied callback function for each point in the hexagon.Parameters:
- callback [Function] — the callback function
eachPointAlongEdgeAxis(e, callback) ⇏ RangeError
This method calls a callback function for each point along a given edge-oriented axis.Parameters:
- e [Integer] — the edge-oriented axis index with 0 running through the hex's center point
- callback [Function] — the function to call for each point
Throws:
- [RangeError] — if the e index is outside of the bounds of the granularity of the coordinate system
isConstrainedPoint(point) → Boolean
This method determines if a given point is constrained to the hex area.Parameters:
- point [Variadic] — the point to check
Returns:
- [Boolean] — true if the point is within the hex area
isEdgePoint(point) → Boolean
This method determines if the given point is along the edge of the hexagon's coordinate system.Parameters:
- point [Variadic] — the point of the coordinate system
Returns:
- [Boolean] — true, if the point is along any of the six edges
nvAtE(e) → Integer ⇏ RangeError
This method returns the number of coordinate points along a specified edge-axis row.Parameters:
- e [Integer] — the edge-oriented axis index with 0 running through the hex's center point
Returns:
- [Integer] — the number of coordinate points along that axis
Throws:
- [RangeError] — if the e index is outside of the bounds of the granularity of the coordinate system
pointAt(point, constrain) → Cartesia.Point
This method converts the hex coordinate point to the user space point.Parameters:
- point [Variadic] — the point in the hex coordinate system
- constrain [Boolean] — true, if conversions outside of the hexagon are not allowed <default: true>
Returns:
- [Cartesia.Point] — the user space point
rectangleCoordsAround(point, width, height, constrain) → Array<Array<Number>>
This convenience function will return the corner user space coordinates of a rectangle round a given center point.Parameters:
- point [Variadic] — the center point of the rectangle
- width [Integer] — the integer width of the rectangle in user space units
- height [Integer] — the integer height of the rectangle in user space units
- constrain [Boolean] — true, if the rectangle's corners are not allowed outside the hexagon <default: true>
Returns:
- [Array<Array<Number>>] — the 4 coordinates of the rectangle, starting top-left and proceeding clockwise
rectanglePointsAround(point, width, height, constrain) → Array<Point>
This convenience function will return the corner user space coordinates of a rectangle round a given center point.Parameters:
- point [Variadic] — the center point of the rectangle
- width [Integer] — the integer width of the rectangle in user space units
- height [Integer] — the integer height of the rectangle in user space units
- constrain [Boolean] — true, if the rectangle's corners are not allowed outside the hexagon <default: true>
Returns:
- [Array<Point>] — the 4 corner points of the rectangle, starting top-left and proceeding clockwise
rotatedCoord(point, segments) → Array<Number>
This method returns a point matching its location in one of the other five partitions of the hexagon.Parameters:
- point [Variadic] — a point in the hex coordinate system
- segments [Integer] — the number of segments to rotate round in a clockwise direction
Returns:
- [Array<Number>] — the associated coord in the hex segment
rotatedPoint(point, segments) → Cartesia.Point
This method returns a point matching its location in one of the other five partitions of the hexagon.Parameters:
- point [Variadic] — a point in the hex coordinate system
- segments [Integer] — the number of segments to rotate round in a clockwise direction
Returns:
- [Cartesia.Point] — the associated point in the hex segment
Class: Cartesia.HexCoordinateSystem.Path
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| hexCoordinateSystem.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all path operation in the hex coordinate system.
Constructor Registry
Method Registry
Constructor Details
new Cartesia.HexCoordinateSystem.Path(hcs, descriptor, constrained)
Parameters:
- hcs [Cartesia.HexCoordinateSystem] — the hex coordinate system to associate with the path
- descriptor [String] — the path string descriptor <default: null>
- constrained [Boolean] — if true, ensures the path is constrained to the hex area <default: true>
Method Details
$parse(descriptor) → Hash ⇏ RuntimeError <private>
This method parses a proposed path descriptor and stores processing information for later use.Parameters:
- descriptor [String] — the proposed path descriptor
Returns:
- [Hash] — tokenized path information, or null on failure
Throws:
- [RuntimeError] — on a parsing error
isConstrained() → Boolean
Returns:
- [Boolean] — true, if the current descriptor is valid
isValid() → Boolean
Returns:
- [Boolean] — true, if the current descriptor is valid
lastCoord() → Array<Number>
This method returns the last HCS coordinate in the path.Returns:
- [Array<Number>] — the last HCS coordinate in the path
lastPoint() → Point
This method returns the last HCS point in the path.Returns:
- [Point] — the last HCS point in the path
mirror(axis, clone) → Cartesia.HexCoordinateSystem.Path
This method either clones the current path and mirrors it or mirrors the current path descriptor in place.Parameters:
- axis [String] — the x,y or z axis to mirror around <default: 'x'>
- clone [Boolean] — will return a cloned, rotated descriptor, if true <default: false>
Returns:
- [Cartesia.HexCoordinateSystem.Path] — this, or a cloned, Cartesia.HexCoordinateSystem.Path instance
normalized() → String
This method returns a string as a normalized path descriptorReturns:
- [String] — the normalized path descriptor
render() → String
This method converts this path to a path descriptor that can be rendered onto the underlying surface.Returns:
- [String] — the rendered path descriptor
renderAsPolygons() → Array<Hash>
This method converts this path to an array of polygon point arrays, if possible, null if not.Returns:
- [Array<Hash>] — an array polygon information, each consisting of an array of points and a Boolean field stating if it is closed
reverse(post_process, clone) → Cartesia.HexCoordinateSystem.Path
This method either clones the current path and reverses it or reverses the current path descriptor in place.Parameters:
- post_process [Boolean] — if true, will process the reverse path to convert tokens to use command options <default: false>
- clone [Boolean] — will return a cloned, rotated descriptor, if true <default: false>
Returns:
- [Cartesia.HexCoordinateSystem.Path] — this, or a cloned, Cartesia.HexCoordinateSystem.Path instance
rotate(segments, clone) → Cartesia.HexCoordinateSystem.Path
This method either clones the current path and rotates it or rotates the current path descriptor in place.Parameters:
- segments [Integer] — the number of 60-degree clockwise rotations to make
- clone [Boolean] — will return a cloned, rotated descriptor, if true <default: false>
Returns:
- [Cartesia.HexCoordinateSystem.Path] — this, or a cloned, Cartesia.HexCoordinateSystem.Path instance
setConstrain(setting)
Parameters:
- setting [Boolean] — sets the constrain paremeter, reparses the descriptor if changing to true
setDescriptor(descriptor) → Boolean
This method sets a new path descriptor.Parameters:
- descriptor [String] — the proposed path descriptor
Returns:
- [Boolean] — true, if the current descriptor is valid
toString() → String
This method converts the Cartesia.HexCoordinateSystem.Path to a string representation.Returns:
- [String] — the string representation of the path.
Namespace: Cartesia.HexGeometry
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| hexGeometry.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This namespace encapsulates all HexGeometry features and functions.
Function Registry
Function Details
ee2vv(size) → Number
This function calculates the vector-to-vector size given the edge-to-edge size of a hexagon.Parameters:
- size [Number] — the edge-to-edge hexagon size
Returns:
- [Number] — the vector-to-vector size of the hexagon
getTallVertexOffsetPoints(size, cx, cy, size) → Hash
This function calculates the vertex offsets from the center of the hexagon given its edge-to-edge size.Parameters:
- size [Number] — the hexagon size
- cx [Number] — the x-coordinate of the hexagon center <default: 0.0>
- cy [Number] — the y-coordinate of the hexagon center <default: 0.0>
- size [Boolean] — true if the given size is edge-to-edge <default: true>
Returns:
- [Hash] — a hash containing size and vertex offset information
getVertexOffsetInfo(size, is_edge_size) → Hash
This function calculates the vertex offsets from the center of the hexagon given its edge-to-edge size.Parameters:
- size [Number] — the hexagon size
- is_edge_size [Boolean] — true if the given size is edge-to-edge <default: true>
Returns:
- [Hash] — a hash containing size and vertex offset information
getVertexOffsets(size, is_edge_size) → Array<Number>
This function calculates the vertex offset dimensions given an edge-to-edge size.Parameters:
- size [Number] — the edge-to-edge hexagon size
- is_edge_size [Boolean] — true if the given size is edge-to-edge <default: true>
Returns:
- [Array<Number>] — a 3-element array containing offsets: offset to the edges, offset to the extreme vertices, offset to the edge vertices
getWideVertexOffsetPoints(size, cx, cy, size) → Hash
This function calculates the vertex offsets from the center of the hexagon given its edge-to-edge size.Parameters:
- size [Number] — the hexagon size
- cx [Number] — the x-coordinate of the hexagon center <default: 0.0>
- cy [Number] — the y-coordinate of the hexagon center <default: 0.0>
- size [Boolean] — true if the given size is edge-to-edge <default: true>
Returns:
- [Hash] — a hash containing size and vertex offset information
vv2ee(size) → Number
This function calculates the edge-to-edge size given the vector-to-vector size of a hexagon.Parameters:
- size [Number] — the vector-to-vector hexagon size
Returns:
- [Number] — the edge-to-edge size of the hexagon
Class: Cartesia.HexMapInfo
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| hexMapInfo.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all hexagon map operations.
Constructor Registry
Method Registry
Constructor Details
new Cartesia.HexMapInfo(cols, rows, hborder, vborder) ⇏ ArgumentError
Parameters:
- cols [Number] — the number of hexagon columns in the map
- rows [Number] — the number of hexagon rows in the map
- hborder [Number] — the size of the horizontal borders (top & bottom)
- vborder [Number] — the size of the vertical borders (left & right)
Throws:
- [ArgumentError] — if the orientation is invalid or unrecognizable
Method Details
$directionToInteger(direction) → Integer <private>
This private method converts a valid wide hex edge direction string to an integer.Parameters:
- direction [String] — the direction string descriptions
Returns:
- [Integer] — an integer ranging from 0 to 5, if valid, where 0 is north and proceeding clockwise, -1 if direction is invalid
bboxAt(hexcol, hexrow) → Object
This method returns the bounding box of the specified hex tileParameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
Returns:
- [Object] — the bounding box of the hex tile
buildHexPathDescriptor(params) → Array<Hash>
This method returns an array of hex path segment information.Parameters:
- params [Hash] — the hex path parameters
Returns:
- [Array<Hash>] — an array of hashes, each containing information required to create one segment of the hex path
calcHexPathBounds(params) → Hash
This method hexcol-based bounds information to aid in hex-in-region detection logicParameters:
- params [Hash] — the hex region parameters
Returns:
- [Hash] — a hash containing bounds values by hexcol
coordAt(hexcol, hexrow) → Object
This method returns the center point of the specified hex tileParameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
Returns:
- [Object] — the center point of the hex tile with an x property and a y property
draw(callback)
This method uses a callback function to draw the hex map for each hex.Parameters:
- callback [Function] — the function to call initialization and hex drawing operations
formatHexPathDescriptor(desc, formatter, needs_bbox) → Hash ⇏ ArgumentError
This method converts a hex path descriptor to a different type of data set.Parameters:
- desc [Array<Hash>] — the hex path descriptor
- formatter [Hash] — a hash containing keyed functions to handle conversion functions
- needs_bbox [Boolean] — true, if the caller wants bounding box information calculated and returned <default: false>
Returns:
- [Hash] — a hash containing the type of data returned as well as a path description in the format defined by the type
Throws:
- [ArgumentError] — if the descriptor is invalid, or the type is invalid
getAdjacentTiles(hexcol, hexrow) → Array<Hash or Null>] the coordinates of the six adjacent hex tiles, in order of [ col,row-1
This method returns an array of hex tile coordinates of the six adjacent hex tiles.Parameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
Returns:
- [Array<Hash or Null>] the coordinates of the six adjacent hex tiles, in order of [ col,row-1 ] — and progressing clockwise
getAlignment(hexcol, hexrow, hexcol2, hexrow2) → Hash or Null
This method determines if two hexes are aligned with each other along the six hexrow directionsParameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
- hexcol2 [Number] — the hex column of the second hex tile
- hexrow2 [Number] — the hex row of the second hex tile
Returns:
- [Hash or Null] — the direction and distance of the aligned hex from the first to the second hex, or Null if not aligned
getSpineAlignment(hexcol, hexrow, hexcol2, hexrow2, extended) → Hash or Null
This method determines if two hexes are aligned with each other along the two horizontal or six hex-spine directionsParameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
- hexcol2 [Number] — the hex column of the second hex tile
- hexrow2 [Number] — the hex row of the second hex tile
- extended [Boolean] — if true, calculates alignment along the non-horizontal hex-spine directions
Returns:
- [Hash or Null] — the direction and distance of the aligned hex from the first to the second hex, or Null if not aligned
hcsFor(hexcol, hexrow, granularity) → Cartesia.HexCoordinateSystem
This method returns a hex coordinate system tied to a specific hex map tile.Parameters:
- hexcol [Number] — the hex column of the map tile
- hexrow [Number] — the hex row of the map tile
- granularity [Integer] — the granularity of the coordinate system
Returns:
- [Cartesia.HexCoordinateSystem] — a CoordinateSystem tied to that specific hex map tile
hexesAway(hexcol, hexrow, to_hexcol, to_hexrow) → Number
This method returns the number of hexes away one hex tile is from anotherParameters:
- hexcol [Number] — the hex column of the origin hex tile
- hexrow [Number] — the hex row of the origin hex tile
- to_hexcol [Number] — the hex column of the distant hex tile
- to_hexrow [Number] — the hex row of the distant hex tile
Returns:
- [Number] — the number of hexes the distant hex tile is from the origin tile
hextantsAway(hexcol, hexrow, to_hexcol, to_hexrow) → Array<String>] the hextant locations of the distant hex tile from the origin: [ 'nw','w','sw','ne','e','se'
This method returns the hextants where one hex tile is from anotherParameters:
- hexcol [Number] — the hex column of the origin hex tile
- hexrow [Number] — the hex row of the origin hex tile
- to_hexcol [Number] — the hex column of the distant hex tile
- to_hexrow [Number] — the hex row of the distant hex tile
Returns:
- [Array<String>] the hextant locations of the distant hex tile from the origin: [ 'nw','w','sw','ne','e','se' ] —
isAdjacent(hexcol, hexrow, hexcol2, hexrow2) → Integer
This method determines if two hexes are adjacent to each otherParameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
- hexcol2 [Number] — the hex column of the second hex tile
- hexrow2 [Number] — the hex row of the second hex tile
Returns:
- [Integer] — the direction of the adjacent from the first to the second hex, or -1 if not adjacent
makeCirclePath(params, needs_bbox) → Hash
This method returns a circular path description based on the incoming single-hex hex region parameters.Parameters:
- params [Hash] — the hex region parameters
- needs_bbox [Boolean] — true, if the caller wants bounding box information calculated and returned <default: false>
Returns:
- [Hash] — a hash containing the center coordinate of the hex and the path descriptor relative to that point.
makeHexPath(params, needs_bbox) → Hash
This method returns a hex path description based on the incoming hex region parameters.Parameters:
- params [Hash] — the hex region parameters
- needs_bbox [Boolean] — true, if the caller wants bounding box information calculated and returned <default: false>
Returns:
- [Hash] — a hash containing the center coordinate of the hex and the path descriptor relative to that point.
makeHexPathCoords(params, needs_bbox) → Hash
This method returns a hex path description based on the incoming hex region parameters.Parameters:
- params [Hash] — the hex region parameters
- needs_bbox [Boolean] — true, if the caller wants bounding box information calculated and returned <default: false>
Returns:
- [Hash] — a hash containing the center coordinate of the hex and the path descriptor relative to that point.
makePathInHex(params, needs_bbox) → Hash
This method returns a circular path description based on the incoming single-hex hex region parameters.Parameters:
- params [Hash] — the hex region parameters
- needs_bbox [Boolean] — true, if the caller wants bounding box information calculated and returned <default: false>
Returns:
- [Hash] — a hash containing the center coordinate of the hex and the path descriptor relative to that point.
mapdims() → Array<Number>
This method returns the map dimensions.Returns:
- [Array<Number>] — the width and height of the map returned as a 2-element array
nearestHexTo(point) → Object
This method returns the nearest hex tile to a given pointParameters:
- point [Variadic] — the specified point
Returns:
- [Object] — the nearest hex tile as a JS object with row, column and dir properties
traceHexPathDescriptor(params, debug) → Array<Hash>
This method returns an array of hex path segment information.Parameters:
- params [Hash] — the hex path parameters
- debug [Number] — debug level <default: 0>
Returns:
- [Array<Hash>] — an array of hashes, each containing information required to create one segment of the hex path
visitNextTile(hexcol, hexrow, direction, unclipped) → Array<Hash> or Null
This method returns the next tile in a given direction.Parameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
- direction [String or Number] — the direction to visit
- unclipped [Boolean] — allow off-map visiting of virtual tiles, if true <default: false>
Returns:
- [Array<Hash> or Null] — an array of hex tile coordinates, or null if a callback function was specified
visitTiles(hexcol, hexrow, n, direction, callback) → Array<Hash> or Null
This method returns an array of hex tile coordinates ranging n hexes out in a given direction and including the target tile.Parameters:
- hexcol [Number] — the hex column of the hex tile
- hexrow [Number] — the hex row of the hex tile
- n [Number] — the number of tiles to visit, limited by the map edges
- direction [String or Number] — the direction to visit
- callback [Function or Null] — the callback function to call for each hex tile visited
Returns:
- [Array<Hash> or Null] — an array of hex tile coordinates, or null if a callback function was specified
Class: Cartesia.Hexagon ← Cartesia.Polygon
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| polygon.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all hexagon-based calculations.
Constructor Registry
Property Registry
Constructor Details
new Cartesia.Hexagon(cpoint, size, orientation)
This constructor creates a new hexagon.Parameters:
- cpoint [Cartesia.Point] — the location of the center of the hexagon
- size [Number] — the edge-to-edge size of the hexagon
- orientation [Cartesia.WIDE or Cartesia.TALL] — the orientation of the hexagon <default: Cartesia.WIDE>
Property Details
height
width
Class: Cartesia.Line
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| line.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all line-based calculations.
Line Representations
This class supports three types of lines: segments, vectors and infinite. As the the name implies, infinite lines are infinite. Segments have two end points, while vectors are infinite in a single direction from an end point.Constructor Registry
Property Registry
Method Registry
Constructor Details
new Cartesia.Line(options) ⇏ ArgumentError
This constructor will build a Cartesia.Line object based on input criteria.Parameters:
- options [Object] — the line parameters, specifying options for the three types of lines
- from [Variadic] — the starting point in a line segment
- to [Variadic] — the end point in a line segment
- reference [Variadic] — the starting point in a line vector or a reference point in an infinite line
- bearing [Variadic] — the angle defining the slope of the line vector
- slope [Variadic] — the angle defining the slope of the line vector
Throws:
- [ArgumentError] — if the options inputs are invalid or unrecognizable
Property Details
length
Method Details
clone() ⇏ Error
This method will build a new Cartesia.Line object identical to the current lineThrows:
- [Error] — if the current line is invalid
closestIntersectionPointFromPoint(point, force_infinite) → Cartesia.Point
This method finds the point on a line closest to a given point.Parameters:
- point [Variadic] — the point to calculate the distance from
- force_infinite [Boolean] — an option to treat the line as an infinite line, regardless of type
Returns:
- [Cartesia.Point] — the point on the line which is closest to the specified point
distanceFromPoint(point) → Number
This method finds distance of a given point to the line at its closest point.Parameters:
- point [Variadic] — the point to calculate the distance from
Returns:
- [Number] — the distance to the given point
intersectionPoint(line) → Cartesia.Line or Cartesia.Point or Null ⇏ ArgumentError
This method finds a point where two lines intersect, if they do.Parameters:
- line [Cartesia.Line] — the line to compare against
Returns:
- [Cartesia.Line or Cartesia.Point or Null] — the intersection point if a point is found, null if not, or itself if the lines are identical
Throws:
- [ArgumentError] — if the given argument is not a line
pointAtDX(dx) → Cartesia.Point or Null
This method finds the point on a line at a distance from the line's reference point in the x-direction.Parameters:
- dx [Number] — the distance from the line's reference point in the y-direction
Returns:
- [Cartesia.Point or Null] — the point on the line, if able to be calculated
pointAtDY(dy) → Cartesia.Point or Null
This method finds the point on a line at a distance from the line's reference point in the y-direction.Parameters:
- dy [Number] — the distance from the line's reference point in the y-direction
Returns:
- [Cartesia.Point or Null] — the point on the line, if able to be calculated
pointAtX(x) → Cartesia.Point or Null
This method finds the point on a line at a specific x-coordinate.Parameters:
- x [Number] — the x-coordinate
Returns:
- [Cartesia.Point or Null] — the point on the line, if able to be calculated
pointAtY(y) → Cartesia.Point or Null
This method finds the point on a line at a specific y-coordinate.Parameters:
- y [Number] — the x-coordinate
Returns:
- [Cartesia.Point or Null] — the point on the line, if able to be calculated
set(options) → Cartesia.Line ⇏ ArgumentError
This method will build a Cartesia.Line object based on input criteria.Parameters:
- options [Object] — the line parameters, specifying options for the three types of lines
- from [Variadic] — the starting point in a line segment
- to [Variadic] — the end point in a line segment
- reference [Variadic] — the starting point in a line vector or a reference point in an infinite line
- bearing [Variadic] — the angle defining the slope of the line vector
- slope [Variadic] — the angle defining the slope of the line vector
Returns:
- [Cartesia.Line] — itself
Throws:
- [ArgumentError] — if the options inputs are invalid or unrecognizable
split() → Array<Cartesia.Line> ⇏ TypeError
This method splits an infinite line into two vectors at its reference point.Returns:
- [Array<Cartesia.Line>] — the two line vectors split at the infinite line's reference point
Throws:
- [TypeError] — if the line is not an infinite line
toArray() → Array<Number>
This method converts a line to a N-element array of reference points and the line's end point, if a segment, or bearing, if not.Returns:
- [Array<Number>] — the array of information
toString() → String
This method converts a line to a string representation.Returns:
- [String] — a string representation of the line
Class: Cartesia.Point
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| point.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all point-based calculations.
Point Representations
Raw point representations used to create and/or operate on this class can come in many forms:- Cartesia.Point
- a 2-element array of x,y coordinates
- x,y coordinates as separate arguments, defaulting to 0,0
This multitude of representations leads to the use of variadic arguments for the functions.
Constructor Registry
Property Registry
Method Registry
Constructor Details
new Cartesia.Point(point) ⇏ ArgumentError
Parameters:
- point [Variadic] — the initial value of the point <default: 0,0>
Throws:
- [ArgumentError] — if the point representation is invalid or unrecognized
Property Details
x
y
Method Details
bearingFrom(point) → Cartesia.Angle ⇏ ArgumentError
This method calculates the bearing of a specified point from this point.Parameters:
- point [Variadic] — the point away from this point <default: 0,0>
Returns:
- [Cartesia.Angle] — the bearing of the specified point from this point
Throws:
- [ArgumentError] — if the point representation is invalid or unrecognized
bearingTo(point) → Cartesia.Angle ⇏ ArgumentError
This method calculates the bearing of this point from a specified point.Parameters:
- point [Variadic] — the point away from this point <default: 0,0>
Returns:
- [Cartesia.Angle] — the bearing of this point from the specified point
Throws:
- [ArgumentError] — if the point representation is invalid or unrecognized
clone() → Cartesia.Point
This function returns a new Cartesia.Point with the same values.Returns:
- [Cartesia.Point] — the new Cartesia.Point object
distanceFrom(point) → Number ⇏ ArgumentError
This method calculates the distance between this point and a specified point.Parameters:
- point [Variadic] — the point away from this point <default: 0,0>
Returns:
- [Number] — the distance between the points
Throws:
- [ArgumentError] — if the point representation is invalid or unrecognized
dxyTo(point) → Array<Number> ⇏ ArgumentError
This method calculates the dx,dy distances from this point to a specified point.Parameters:
- point [Variadic] — the point away from this point <default: 0,0>
Returns:
- [Array<Number>] — the 2-element array of dx,dy distances between the points
Throws:
- [ArgumentError] — if the point representation is invalid or unrecognized
moveTo$(distance, bearing) → Cartesia.Point ⇏ ArgumentError
This method move this point to a new location some distance and bearing from its current location.Parameters:
- distance [Number] — the distance to move this point from its current location
- bearing [Cartesia.Angle or Number] — the directional bearing from this point to move itself
Returns:
- [Cartesia.Point] — itself
Throws:
- [ArgumentError] — if the point or angle representation is invalid or unrecognized
newPointFrom(distance, bearing) → Cartesia.Point
This method creates a new point some distance and bearing from this point.Parameters:
- distance [Number] — the distance from its current location
- bearing [Cartesia.Angle or Number] — the directional bearing from this point
Returns:
- [Cartesia.Point] — the new Cartesia.Point
newPointRotatedFrom(angle, point) → Cartesia.Point ⇏ ArgumentError
This method creates a new point some radial distance around another point by a specified angle.Parameters:
- angle [Cartesia.Angle or Number] — the angle argument as a Cartesia.Angle object or a measurement in radians
- point [Variadic] — the point away from this point <default: 0,0>
Returns:
- [Cartesia.Point] — ths new Cartesia.Point
Throws:
- [ArgumentError] — if the point or angle representation is invalid or unrecognized
newPointUsingDXY(dx, dy) → Cartesia.Point
This method creates a new point some dx,dy distance from this point.Parameters:
- dx [Number] — the dx distance
- dy [Number] — the dy distance
Returns:
- [Cartesia.Point] — the new Cartesia.Point
rotateAround$(angle, point) → Cartesia.Point ⇏ ArgumentError
This method moves this point around another point by a specified angle.Parameters:
- angle [Cartesia.Angle or Number] — the angle argument as a Cartesia.Angle object or a measurement in radians
- point [Variadic] — the point away from this point <default: 0,0>
Returns:
- [Cartesia.Point] — itself
Throws:
- [ArgumentError] — if the point or angle representation is invalid or unrecognized
set(point) → Cartesia.Point ⇏ ArgumentError
This method sets the point's value.Parameters:
- point [Variadic] — the value of the point to set <default: 0,0>
Returns:
- [Cartesia.Point] — itself
Throws:
- [ArgumentError] — if the point representation is invalid or unrecognized
toArray() → Array<Number>
This method converts this point to a coordinate array.Returns:
- [Array<Number>] — the coordinate array
toString() → String
This method converts the point to a string representation.Returns:
- [String] — the string representation of the point.
Class: Cartesia.Polygon
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| polygon.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class handles all polygon-based calculations.
Constructor Registry
Method Registry
Constructor Details
new Cartesia.Polygon(points) ⇏ ArgumentError
This constructor creates a new polygon based on the supplied points, in order of connection.Parameters:
- points [Array<Cartesia.Point>] — the points which make up the polygon
Throws:
- [ArgumentError] — if the supplied points vector is invalid
Method Details
$ptDistanceInfo(point) → Variadic ⇏ ArgumentError <private>
This private method calculates the point and distance between a given point and the polygonParameters:
- point [Cartesia.Point] — the point to compare against
Returns:
- [Variadic] — a 2-element array containing the point on the polygon which is closest and the distance between those points
Throws:
- [ArgumentError] — if the given point is invalid
appendPoint(point) → Cartesia.Polygon ⇏ ArgumentError
This method appends a point to the polygon's point list.Parameters:
- point [Array<Cartesia.Point>] — the point to append to the polygon
Returns:
- [Cartesia.Polygon] — itself
Throws:
- [ArgumentError] — if the supplied points vector is invalid
appendPoints(points) → Cartesia.Polygon ⇏ ArgumentError
This method appends points to the polygon's point list.Parameters:
- points [Array<Cartesia.Point>] — the points to append to the polygon
Returns:
- [Cartesia.Polygon] — itself
Throws:
- [ArgumentError] — if the supplied points vector is invalid
boundingBox() → Cartesia.Polygon
This method returns the bounding box of the polygon.Returns:
- [Cartesia.Polygon] — the bounding box rectangle containing the polygon
closestIntersectionPointFromPoint(point) → Cartesia.Point
This method finds the point on the polygon closest to the specified point.Parameters:
- point [Cartesia.Point] — the reference point to determining the closest point to
Returns:
- [Cartesia.Point] — the closest point of the polygon to the reference point
deletePointAt(index) → Cartesia.Polygon ⇏ ArgumentError
This method deletes a point from the polygon.Parameters:
- index [Integer] — the zero-based index of the point of the polygon to delete
Returns:
- [Cartesia.Polygon] — itself
Throws:
- [ArgumentError] — if the index is invalid
distanceFromPoint(point) → Number
This method finds the closest distance between a given point and any point of the polygon.Parameters:
- point [Cartesia.Point] — the reference point to determining the closest point to
Returns:
- [Number] — the closest distance to the point
insertPoint(point, index) → Cartesia.Polygon ⇏ ArgumentError
This method inserts a point into the polygon list at the specified location.Parameters:
- point [Array<Cartesia.Point>] — the point to insert into the polygon
- index [Integer] — the zero-based index of the point of the polygon to delete
Returns:
- [Cartesia.Polygon] — itself
Throws:
- [ArgumentError] — if the supplied points vector is invalid
insertPoints(points, index) → Cartesia.Polygon ⇏ ArgumentError
This method inserts points to the polygon's point list at the specified location.Parameters:
- points [Array<Cartesia.Point>] — the points to insert into the polygon
- index [Integer] — the zero-based index of the point of the polygon to delete
Returns:
- [Cartesia.Polygon] — itself
Throws:
- [ArgumentError] — if the supplied points vector is invalid
isPointInside(point) → Boolean ⇏ ArgumentError
This method determines if a given point is inside the polygon.Parameters:
- point [Cartesia.Point] — the point we are checking for
Returns:
- [Boolean] — true, if the point is inside the polygon
Throws:
- [ArgumentError] — if the point is invalid
lineSegments() → Array<Cartesia.Line>
This method returns the array of line segments which will make up the polygon.Returns:
- [Array<Cartesia.Line>] — the array of line segments
set(points) → Cartesia.Polygon ⇏ ArgumentError
This constructor creates a new polygon based on the supplied points, in order of connection.Parameters:
- points [Array<Cartesia.Point>] — the points which make up the polygon
Returns:
- [Cartesia.Polygon] — itself
Throws:
- [ArgumentError] — if the supplied points vector is invalid
toString() → String
This method returns a string represention of the polygon.Returns:
- [String] — the string representation
Codoc: Code Documentation Generator (0.99.2)
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitter.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitters/dokuwiki.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitters/html.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitters/reporter.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/fblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/gblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/c.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/cruby.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/js.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/ruby.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/lblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/logger.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/parser.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/tag.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Contents Directory
Class: Codoc
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitter.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitters/dokuwiki.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitters/html.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/emitters/reporter.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/fblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/gblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/c.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/cruby.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/js.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/languages/ruby.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/lblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/logger.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/parser.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
| lib/codoc/tag.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Overview
Class Method Registry
Class Method Details
do(-arglist-)
This method is used to parse, report and generate documentation.Parameters:
- -arglist- [Hash] — the processing parameters
- type [Symbol] — the type of codoc object to process
- item [Symbol] — the type of codoc object to process
- options [Hash] — the type of codoc object to process
- verbose [Boolean] — the verbosity of the operation <default: false>
- as [Symbol] — the type of documentation to generate if the parsing is successful
- folder [String] — the type of documentation to generate if the parsing is successful
- basename [String] — the type of documentation to generate if the parsing is successful
Class: Codoc::CParser
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/languages/c.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::CRubyParser
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/languages/cruby.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::DokuWikiEmitter
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/emitters/dokuwiki.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::Emitter
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/emitter.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class Constant Registry
Class Constant Details
CMAP
Class: Codoc::FBlock
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/fblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::GBlock
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/gblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::HTMLEmitter
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/emitters/html.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::JSParser
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/languages/js.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::LBlock
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/lblock.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::Logger
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/logger.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::Parser
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/parser.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class Constant Registry
Class Constant Details
CMAP
EXTMAP
HINT_TAGS
Class: Codoc::Reporter
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/emitters/reporter.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::RubyParser
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/languages/ruby.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class: Codoc::Tag
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/codoc/tag.rb | Ruby | Kenneth F. Guerin | Copyright © 2021-2022, Kenneth F. Guerin, all rights reserved. |
Overview
PepperMill: GUI Library (0.2.2)
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/application.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/buildable.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/eventmanager.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/mainwindow.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/menu.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/menubar.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/menuitem.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/utils.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/window.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/attach.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-application-delegate.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-application.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-framework.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-interface.h | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-mainwindow-delegate.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-mainwindow.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-menu.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-menubar.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-menuitem.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/current.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/extconf.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-application.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-framework.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-mainwindow.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-menu.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-menubar.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-menuitem.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-window.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/init.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/peppermill.h | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Contents Directory
Cruby: PepperMill
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/application.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/buildable.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/eventmanager.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/mainwindow.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/menu.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/menubar.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/menuitem.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/utils.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| lib/peppermill/window.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/attach.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/cocoa-framework.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/current.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-framework.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/init.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
Class: PepperMill::Application
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/application.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages the application.
Constructor Registry
Method Registry
Constructor Details
new(id, xmlfile, p)
The Application initializerParameters:
- id [String] — the application identifier
- xmlfile [String] — an optional filename containing application resources in XML format <default: nil>
- p [Proc] — an optional filename containing application resources in XML format <default: nil>
Method Details
Sets/unsets the onmenu notification.
Parameters:
- block [Block] — a block of code that is passed to the EventManager if a proc is not supplied <default: nil>
Class: PepperMill::Buildable
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/buildable.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages the PepperMill buildable interface.
Constructor Registry
Method Registry
Constructor Details
new(app)
The Buildable initializerParameters:
- app [PepperMill::Application] — the owning application
Method Details
build(key)
This method requests properties from the application and applies them.Parameters:
- key [String] — the key to search for
Class: PepperMill::EventManager
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/eventmanager.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages the application.
Constructor Registry
Constructor Details
new(id, xmlfile, p)
The Application initializerParameters:
- id [String] — the application identifier
- xmlfile [String] — an optional filename containing application resources in XML format <default: nil>
- p [Proc] — an optional filename containing application resources in XML format <default: nil>
Function: PepperMill::Init_pixmill
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/init.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function creates the PepperMill Ruby module and initializes / requires various subclasses within it.
The following methods and subclasses are created and/or loaded into the PepperMill module space: - PepperMill::framework (method) - PepperMill::Application (subclass) - PepperMill::MainWindow (subclass)
Class: PepperMill::MainWindow
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/mainwindow.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages the PepperMill application main window.
Constructor Registry
Method Registry
Constructor Details
new(app, content)
The MainWindow initializerParameters:
- app [PepperMill::Application] — the owning application
- content [Hash] — the content options of the item <default: nil>
Method Details
close
This method closes the windowonclose(block)
Sets/unsets the onclose notification.Parameters:
- block [Block] — a block of code that is passed to the EventManager if a proc is not supplied <default: nil>
onpropertychange(command, args)
This method handles main window content changes, passing them to the underlying native layer.Parameters:
- command [Symbol] — the content change parameters <default: :assign>
- args [Array<Any>] — optional parameters used to satisfy the command
onresize(block)
Sets/unsets the onresize notification.Parameters:
- block [Block] — a block of code that is passed to the EventManager if a proc is not supplied <default: nil>
set_height(height)
This method sets the main window heightParameters:
- height [String or Numeric] — the new height
set_size(width, height)
This method sets the main window sizeParameters:
- width [String or Numeric] — the new width
- height [String or Numeric] — the new height
set_title(title)
This method sets the main window titleParameters:
- title [String] — the title
set_width(width)
This method sets the main window widthParameters:
- width [String or Numeric] — the new width
show
This method shows the windowClass: PepperMill::Menu
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/menu.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages the PepperMill menus.
Constructor Registry
Method Registry
Constructor Details
new(app, content)
The Menu initializerParameters:
- app [PepperMill::Application] — the owning application
- content [Hash] — the content options of the item <default: nil>
Method Details
[](index)
This method returns the Nth section in the menu.Parameters:
- index [Integer] — the index
find(signal, deep) → PepperMill::MenuItem or Nil
This method finds action menu item in its list of menu items or, optionally, submenus.Parameters:
- signal [Symbol] — the signal of the menu item to find
- deep [Boolean] — if true, searches submenu as well <default: true>
Returns:
- [PepperMill::MenuItem or Nil] — the found menu item or nil if not found
onpropertychange(command, args)
This method handles main window content changes, passing them to the underlying native layer.Parameters:
- command [Symbol] — the content change parameters <default: :assign>
- args [Array<Any>] — optional parameters used to satisfy the command
sections
This method returns the list of sections in the menu.to_s
This method emits a string representation of the object.Class: PepperMill::MenuBar
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/menubar.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages the PepperMill application menu bar.
Constructor Registry
Method Registry
Constructor Details
new(app, content)
The MenuBar initializerParameters:
- app [PepperMill::Application] — the owning application
- content [Hash] — the content options of the item <default: nil>
Method Details
[](index)
This method returns the Nth item in the menu.Parameters:
- index [Integer] — the index
attach
This method attaches the window to the main window.find(signal) → PepperMill::MenuItem or Nil
This method finds an action menu item in its list of menu items or submenus thereof.Parameters:
- signal [Symbol] — the signal of the menu item to find
Returns:
- [PepperMill::MenuItem or Nil] — the found menu item or nil if not found
items
This method returns the list of items in the menu.length
This method returns the list of items in the menu.onpropertychange(command, args)
This method handles main window content changes, passing them to the underlying native layer.Parameters:
- command [Symbol] — the content change parameters <default: :assign>
- args [Array<Any>] — optional parameters used to satisfy the command
Class: PepperMill::MenuItem
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/menuitem.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages the PepperMill menu items.
Constructor Registry
Method Registry
Constructor Details
new(app, content)
The MenuItem initializerParameters:
- app [PepperMill::Application] — the owning application
- content [Hash] — the content options of the item <default: nil>
Method Details
accelerator → Hash
This method is a property getter for acceleratorReturns:
- [Hash] — the menu item accelerator info
disable
This method disables the menu item.disabled? → Boolean
This method is a state requestor for the disabled state of the menu itemReturns:
- [Boolean] — true if the menu item type is disabled
enable
This method enables the menu item.is_action? → Boolean
This method is a state requestor for the type of the menu itemReturns:
- [Boolean] — true if the menu item type is :action
This method is a state requestor for the type of the menu item
Returns:
- [Boolean] — true if the menu item type is :submenu
label → String
This method is a property getter for labelReturns:
- [String] — the menu item label
onpropertychange(command, args)
This method handles main window content changes, passing them to the underlying native layer.Parameters:
- command [Symbol] — the content change parameters <default: :assign>
- args [Array<Any>] — optional parameters used to satisfy the command
signal → Symbol
This method is a property getter for signalReturns:
- [Symbol] — the menu item signal
This method is a property getter for submenu
Returns:
- [PepperMill::Menu] — the menu item submenu
to_s
This method emits a string representation of the object.type → Symbol
This method is a property getter for typeReturns:
- [Symbol] — the menu item type
Class: PepperMill::Utils
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/utils.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class contains utility singleton methods.
Class Method Registry
Class Method Details
parse_dimension_style(dim) → Hash
Parameters:
- dim [String or Number] — the dimension style string or number
Returns:
- [Hash] — dimension properties
Class: PepperMill::Window
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/peppermill/window.rb | Ruby | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This class manages PepperMill windows.
Constructor Registry
Constructor Details
new(app, id, style)
The Application initializerParameters:
- app [PepperMill::Application] — the owning application
- id [String] — the window identifier
- style [Hash] — the window style properties
Function: PepperMill::rb_peppermill_attach ⟼ attach
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/attach.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function attaches an application object to the class.
Function: PepperMill::rb_peppermill_cocoa_framework ⟼ framework
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-framework.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function returns a symbol describing the underlying PepperMill framework.
Function: PepperMill::rb_peppermill_current ⟼ current
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/current.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function returns the current application object.
Function: PepperMill::rb_peppermill_gtk_framework ⟼ framework
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-framework.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function returns a symbol describing the underlying PepperMill framework.
Cruby: PepperMill::NativeApplication
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-application.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-application.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
Function: PepperMill::NativeApplication::gtk_activate
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-application.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function is called post-run by GTK to handle initialization activities.
Function: PepperMill::NativeApplication::rb_application_cocoa_initialize ⟼ initialize
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-application.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeApplication constructor.
Function: PepperMill::NativeApplication::rb_application_cocoa_launch ⟼ launch
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-application.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeApplication launch method.
Function: PepperMill::NativeApplication::rb_application_cocoa_terminate ⟼ terminate
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-application.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeApplication terminate method.
Function: PepperMill::NativeApplication::rb_application_gtk_initialize ⟼ initialize
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-application.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeApplication constructor.
Function: PepperMill::NativeApplication::rb_application_gtk_launch ⟼ launch
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-application.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeApplication launch method.
Function: PepperMill::NativeApplication::rb_application_gtk_terminate ⟼ terminate
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-application.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeApplication terminate method.
Cruby: PepperMill::NativeMainWindow
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-mainwindow.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-mainwindow.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
Function: PepperMill::NativeMainWindow::rb_mainwindow_cocoa_initialize ⟼ initialize
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-mainwindow.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow constructor.
Function: PepperMill::NativeMainWindow::rb_mainwindow_cocoa_set_size ⟼ set_size
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-mainwindow.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow show method.
Function: PepperMill::NativeMainWindow::rb_mainwindow_cocoa_set_title ⟼ set_title
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-mainwindow.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow show method.
Function: PepperMill::NativeMainWindow::rb_mainwindow_cocoa_show ⟼ show
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-mainwindow.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow show method.
Function: PepperMill::NativeMainWindow::rb_mainwindow_gtk_close ⟼ close
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-mainwindow.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow close method.
Function: PepperMill::NativeMainWindow::rb_mainwindow_gtk_initialize ⟼ initialize
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-mainwindow.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow constructor.
Function: PepperMill::NativeMainWindow::rb_mainwindow_gtk_set_size ⟼ set_size
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-mainwindow.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow show method.
Function: PepperMill::NativeMainWindow::rb_mainwindow_gtk_set_title ⟼ set_title
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-mainwindow.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow show method.
Function: PepperMill::NativeMainWindow::rb_mainwindow_gtk_show ⟼ show
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-mainwindow.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeMainWindow show method.
Cruby: PepperMill::NativeMenu
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-menu.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-menu.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
Cruby: PepperMill::NativeMenuBar
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-menubar.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-menubar.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
Cruby: PepperMill::NativeMenuItem
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/cocoa-menuitem.m | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
| ext/peppermill/gtk-menuitem.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
Cruby: PepperMill::NativeWindow
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-window.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
Function: PepperMill::NativeWindow::rb_window_gtk_initialize ⟼ initialize
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/peppermill/gtk-window.c | C | Kenneth F. Guerin | Copyright © 2025, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PepperMill::NativeWindow constructor.
PixMill: Graphics Library (1.3.5)
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/boundingbox.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/colortable.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/colortools.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/composites.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/graphicsstate.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/ncsctab.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/pathdescriptor.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/pathengine.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/resenectab.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/shader.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/stencil/fleur-de-lis.rb | Ruby | Kenneth F. Guerin | Copyright © 2022, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/stencil/gear.rb | Ruby | Kenneth F. Guerin | Copyright © 2022, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/stencil/star.rb | Ruby | Kenneth F. Guerin | Copyright © 2022, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/textattributelist.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/w3cctab.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/cairo-context.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/cairo-pattern.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/cairo-surface.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/canvas.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/extconf.h | C | ||
| ext/pixmill/extconf.rb | Ruby | ||
| ext/pixmill/init.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/ncolor.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/pango-attrlist.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/pango-fontdesc.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/pango-iter.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/pango-layout.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
| ext/pixmill/pixmill.h | C | ||
| ext/pixmill/utils.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Contents Directory
Module: PixMill
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/boundingbox.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/colortable.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/colortools.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/composites.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/graphicsstate.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/ncsctab.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/pathdescriptor.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/pathengine.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/resenectab.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/shader.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/textattributelist.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/w3cctab.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
Constant Registry
Constant Details
NCS_CTAB <read-only>
This color table defines NCS color names and specificationsRESENE_CTAB <read-only>
This color table defines Resene color names and specificationsW3C_CTAB <read-only>
This color table defines W3C color names and specificationsClass: PixMill::BoundingBox
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/boundingbox.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
The BoundingBox class is used for graphics object layouts. In essence, it's a simple rectangle with some shortcut variables, such as x2,y2 and cx,cy
Constructor Registry
Class Method Registry
Method Registry
Constructor Details
new(x, y, w, h, x2, y2, cx, cy, xr, yr)
Parameters:
- x [Numeric] — the left coordinate of the bounding box
- y [Numeric] — the top coordinate of the bounding box
- w [Numeric] — the width of the bounding box
- h [Numeric] — the height of the bounding box
- x2 [Numeric] — the right coordinate of the bounding box
- y2 [Numeric] — the bottom coordinate of the bounding box
- cx [Numeric] — the horizontal center coordinate of the bounding box
- cy [Numeric] — the vertical center coordinate of the bounding box
- xr [Numeric] — the horizontal radius of the bounding box
- yr [Numeric] — the vertical radius of the bounding box
Class Method Details
new_from_box(x, y, x2, y2) → BoundingBox
Parameters:
- x [Numeric] — the left coordinate of the bounding box
- y [Numeric] — the top coordinate of the bounding box
- x2 [Numeric] — the right coordinate of the bounding box
- y2 [Numeric] — the bottom coordinate of the bounding box
Returns:
- [BoundingBox] — a newly created bounding box
new_from_cxyr(cx, cy, r) → BoundingBox
Parameters:
- cx [Numeric] — the horizontal center coordinate of the bounding box
- cy [Numeric] — the vertical center coordinate of the bounding box
- r [Numeric] — the circular radius
Returns:
- [BoundingBox] — a newly created bounding box
new_from_cxywh(cx, cy, w, h) → BoundingBox
Parameters:
- cx [Numeric] — the horizontal center coordinate of the bounding box
- cy [Numeric] — the vertical center coordinate of the bounding box
- w [Numeric] — the width of the bounding box
- h [Numeric] — the height of the bounding box
Returns:
- [BoundingBox] — a newly created bounding box
new_from_cxyxryr(cx, cy, xr, yr) → BoundingBox
Parameters:
- cx [Numeric] — the horizontal center coordinate of the bounding box
- cy [Numeric] — the vertical center coordinate of the bounding box
- xr [Numeric] — the horizontal elliptical radius
- yr [Numeric] — the vertical elliptical radius
Returns:
- [BoundingBox] — a newly created bounding box
new_from_ptr(pts) → BoundingBox
Parameters:
- pts [Array<Numeric>] — the points of the polygon
Returns:
- [BoundingBox] — a newly created bounding box
new_from_xywh(x, y, w, h) → BoundingBox
Parameters:
- x [Numeric] — the left coordinate of the bounding box
- y [Numeric] — the top coordinate of the bounding box
- w [Numeric] — the width of the bounding box
- h [Numeric] — the height of the bounding box
Returns:
- [BoundingBox] — a newly created bounding box
Method Details
bottomleft → Array<Numeric>
Returns:
- [Array<Numeric>] — the x and y2 values as a single array
bottomright → Array<Numeric>
Returns:
- [Array<Numeric>] — the x2 and y2 values as a single array
center → Array<Numeric>
Returns:
- [Array<Numeric>] — the cx and cy values as a single array
move!(dx, dy) → BoundingBox
Parameters:
- dx [Numeric] — the distance to move in the x direction
- dy [Numeric] — the distance to move in the y direction
Returns:
- [BoundingBox] — the current bounding box
move_to!(x, y) → BoundingBox
Parameters:
- x [Numeric] — the new location along the x axis
- y [Numeric] — the new location along the y axis
Returns:
- [BoundingBox] — the current bounding box
moved(dx, dy) → BoundingBox
Parameters:
- dx [Numeric] — the distance to move in the x direction
- dy [Numeric] — the distance to move in the y direction
Returns:
- [BoundingBox] — the new bounding box
position → Array<Numeric>
Returns:
- [Array<Numeric>] — the x and y values as a single array
resize!(dw, dh) → BoundingBox
Parameters:
- dw [Numeric] — the width difference to resize
- dh [Numeric] — the height difference to resize
Returns:
- [BoundingBox] — the current bounding box
resize_to!(w, h) → BoundingBox
Parameters:
- w [Numeric] — the new width
- h [Numeric] — the new height
Returns:
- [BoundingBox] — the current bounding box
resized(dw, dh) → BoundingBox
Parameters:
- dw [Numeric] — the width difference to resize
- dh [Numeric] — the height difference to resize
Returns:
- [BoundingBox] — the new bounding box
set_from(cx, cy, w, h) → BoundingBox
Parameters:
- cx [Numeric] — the horizontal center coordinate of the bounding box
- cy [Numeric] — the vertical center coordinate of the bounding box
- w [Numeric] — the width of the bounding box
- h [Numeric] — the height of the bounding box
Returns:
- [BoundingBox] — the current bounding box
set_from_box(x, y, x2, y2) → BoundingBox
Parameters:
- x [Numeric] — the left coordinate of the bounding box
- y [Numeric] — the top coordinate of the bounding box
- x2 [Numeric] — the right coordinate of the bounding box
- y2 [Numeric] — the bottom coordinate of the bounding box
Returns:
- [BoundingBox] — the current bounding box
set_from_cxyr(cx, cy, r) → BoundingBox
Parameters:
- cx [Numeric] — the horizontal center coordinate of the bounding box
- cy [Numeric] — the vertical center coordinate of the bounding box
- r [Numeric] — the circular radius
Returns:
- [BoundingBox] — the current bounding box
set_from_cxyxryr(cx, cy, xr, yr) → BoundingBox
Parameters:
- cx [Numeric] — the horizontal center coordinate of the bounding box
- cy [Numeric] — the vertical center coordinate of the bounding box
- xr [Numeric] — the horizontal elliptical radius
- yr [Numeric] — the vertical elliptical radius
Returns:
- [BoundingBox] — the current bounding box
set_from_pts(pts) → BoundingBox
Parameters:
- pts [Array<Numeric>] — the points of the polygon
Returns:
- [BoundingBox] — the current bounding box
set_from_xywh(x, y, w, h) → BoundingBox
Parameters:
- x [Numeric] — the left coordinate of the bounding box
- y [Numeric] — the top coordinate of the bounding box
- w [Numeric] — the width of the bounding box
- h [Numeric] — the height of the bounding box
Returns:
- [BoundingBox] — the current bounding box
size → Array<Numeric>
Returns:
- [Array<Numeric>] — the w and h values as a single array
to_ary → Array<Numeric>
Returns:
- [Array<Numeric>] — an 8-element array of bounding box data
to_s → String
Returns:
- [String] — a string representation of the bounding box
topright → Array<Numeric>
Returns:
- [Array<Numeric>] — the x2 and y values as a single array
xywh → Array<Numeric>
Returns:
- [Array<Numeric>] — the x, y, w and h values as a single array
Class: PixMill::CallbackRegion ← PixMill::Rectangle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A CallbackRegion is simply a Rectangle with an assigned callback to handle the draw method.
Constructor Registry
Method Registry
Constructor Details
new(parent, w, h, cb, args, scale, gs)
The CallbackRegion ConstructorParameters:
- parent [MarkingObject] — the parent of the callback rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- cb [Lambda] — the code to call to draw withing the callback rectangle
- args [Array<Mixed>] — the arguments to pass to the callback code (optional)
- scale [Integer] — the user unit scale of the rectangle (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
cliptrace(gs, force_placement) → CallbackRegion
Trace the callback rectangle's area onto the object heirarchy foundation for clipping purposesParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [CallbackRegion] — the current callback region object
draw(gs) → CallbackRegion
Draw the callback region content into the layout areaParameters:
- gs [GraphicsState] — the graphics state to use to color the object
Returns:
- [CallbackRegion] — the current callback region object
set(parent, w, h, cb, args, scale, gs) → CallbackRegion
Set the callback's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the callback rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- cb [Lambda] — the code to call to draw withing the callback rectangle
- args [Array<Mixed>] — the arguments to pass to the callback code (optional)
- scale [Integer] — the user unit scale of the rectangle (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [CallbackRegion] — the current callback region object
trace
Override the MarkingObject.trace methodClass: PixMill::Circle ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A Circle is a round object defined and bounded by its radius.
Constructor Registry
Method Registry
Constructor Details
new(parent, r, scale, gs)
The Circle ConstructorParameters:
- parent [MarkingObject] — the parent of the circle
- r [Numeric] — the radius of the circle
- scale [Integer] — the user unit scale of the circle (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
place(gs) → Circle
Place the circle using the radii layoutParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [Circle] — the current circle
set(parent, r, scale, gs) → Circle
Set the circle's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the circle
- r [Numeric] — the radius of the circle
- scale [Integer] — the user unit scale of the circle (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Circle] — the current circle
trace(gs, force_placement) → Circle
Trace the circle's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Circle] — the current circle
xywhrr → Array<Numeric> <private>
Calculate the circle's parameters when tracing itReturns:
- [Array<Numeric>] — the x, y and radius parameters to use when tracing the circle
Class: PixMill::ColorTable
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/colortable.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
Overview
The color table is a series of color specifications organized by keys, which are Ruby symbols only RGB or RGBA specifications are supported at this time
Constructor Registry
Method Registry
Constructor Details
new(ctab)
Parameters:
- ctab [Hash] — a hash of symbolic keys and color specification values <default: nil>
Method Details
[](key) → String or Array<Integer> or Array<Numeric>
Parameters:
- key [Symbol] — the color specification to retrieve
Returns:
- [String or Array<Integer> or Array<Numeric>] — the retrieved color specification
delete(key) → ColorTable
Parameters:
- key [Symbol] — the color specification to delete
Returns:
- [ColorTable] — the current color table instance
get(key, type) → String or Array<Integer> or Array<Numeric>
Parameters:
- key [Symbol] — the color specification to retrieve
- type [Symbol] — the type of color specification to retrieve, or nil if the stored representation is sufficient <default: nil>
Returns:
- [String or Array<Integer> or Array<Numeric>] — the retrieved color specification
get_alpha(key) → Integer
Parameters:
- key [Hash] — a lookup key
Returns:
- [Integer] — the alpha value of the color table entry
get_closest_cspec_key(target) → Symbol
Parameters:
- target [String or Array<Integer> or Array<Numeric>] — the target color specification to match
Returns:
- [Symbol] — the key of the color specification in the color table which is closest to the given color
get_key_spec(key) → Array<Numeric>
Parameters:
- key [Symbol] — the color specification to retrieve
Returns:
- [Array<Numeric>] — the Cairo-specific color specification
keys → Array<Symbol>
Returns:
- [Array<Symbol>] — an array of color table keys
load(ctab, must_be_unique) → ColorTable
Parameters:
- ctab [Hash] — a hash of symbolic keys and color specification values
- must_be_unique [Boolean] — true if duplicate key overwrites are not allowed <default: false>
Returns:
- [ColorTable] — the current color table instance
load_alpha(atab) → ColorTable
Parameters:
- atab [Hash] — a hash of symbolic keys and alpha integer values
Returns:
- [ColorTable] — the current color table instance
set(key, cspec, must_be_unique) → ColorTable
Parameters:
- key [Hash] — a lookup key
- cspec [String or Array<Integer> or Array<Numeric>] — a color specification
- must_be_unique [Boolean] — true if duplicate key overwrites are not allowed <default: false>
Returns:
- [ColorTable] — the current color table instance
set_alpha(key, alpha) → ColorTable
Parameters:
- key [Hash] — a lookup key
- alpha [Integer] — the alpha value
Returns:
- [ColorTable] — the current color table instance
Module: PixMill::ColorTools
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/colortools.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
Overview
The ColorTools Module This module exists to translate among different color representations: - hashstrings - atstrings (similar to hashstrings, but contains alpha / transparency data at the end) - arrays containing floating point values between 0.0 and 1.0 - arrays containing integer values between 0 and 255 The caller needs to keep track of the color space of the colors as well as the existance of alpha data in the cspec. Both RGBA and CMYK color specifications are 4 element specifications. This is why we have use atstrings for alpha-aware specifications and hashstrings for opaque specifications.
Method Registry
Method Details
color_to_gray_rgb_cspec(cspec) → String or Array<Integer> or Array<Float>
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to convert
Returns:
- [String or Array<Integer> or Array<Float>] — the color specification of the converted gray color
convert_cmyk_cspec(type, cspec) → String or Array<Integer> or Array<Float>
Parameters:
- type [Symbol] — the type of specification requested { :hashstring, :integers, :floats }
- cspec [String or Array<Integer> or Array<Float>] — the color specification to convert
Returns:
- [String or Array<Integer> or Array<Float>] — the new color specification
convert_cmyka_cspec(type, cspec) → String or Array<Integer> or Array<Float>
Parameters:
- type [Symbol] — the type of specification requested { :hashstring, :integers, :floats }
- cspec [String or Array<Integer> or Array<Float>] — the color specification to convert
Returns:
- [String or Array<Integer> or Array<Float>] — the new color specification
convert_cmyka_cspec_to_cmyk_cspec(type, cspec) → String or Array<Integer> or Array<Float>
Parameters:
- type [Symbol] — the type of specification requested { :hashstring, :integers, :floats }
- cspec [String or Array<Integer> or Array<Float>] — the CMYKA color specification to convert
Returns:
- [String or Array<Integer> or Array<Float>] — the new CMYK color specification
convert_rgb_cspec(type, cspec) → String or Array<Integer> or Array<Float>
Parameters:
- type [Symbol] — the type of specification requested { :hashstring, :integers, :floats }
- cspec [String or Array<Integer> or Array<Float>] — the color specification to convert
Returns:
- [String or Array<Integer> or Array<Float>] — the new color specification
convert_rgba_cspec(type, cspec) → String or Array<Integer> or Array<Float>
Parameters:
- type [Symbol] — the type of specification requested { :hashstring, :integers, :floats }
- cspec [String or Array<Integer> or Array<Float>] — the color specification to convert
Returns:
- [String or Array<Integer> or Array<Float>] — the new color specification
convert_rgba_cspec_to_rgb_cspec(cspec) → String or Array<Integer> or Array<Float>
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the RGBA color specification to convert
Returns:
- [String or Array<Integer> or Array<Float>] — the new RGB color specification
extract_alpha_from_rgba_cspec(cspec) → Integer
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the RGBA color specification to convert
Returns:
- [Integer] — the alpha value as an integer
is_gray_rgb_cspec?(cspec) → Boolean
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Boolean] — true if the color is gray
is_valid_cmyk_cspec?(cspec) → Boolean
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Boolean] — true if the color specification is valid
is_valid_cmyka_cspec?(cspec) → Boolean
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Boolean] — true if the color specification is valid
is_valid_rgb_spec?(cspec) → Boolean
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Boolean] — true if the color specification is valid
is_valid_rgba_cspec?(cspec) → Boolean
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Boolean] — true if the color specification is valid
random_gray_rgb_cspec(rng, base, range, type) → String or Array<Integer> or Array<Float>
Parameters:
- rng [Object] — a random number generator
- base [Integer] — the base value to randomize from
- range [Integer] — the maximum value in a randomized range starting at 0
- type [Symbol] — the type of color specification to return
Returns:
- [String or Array<Integer> or Array<Float>] — an integer array color specification of a gray color
random_rgb_cspec(rng, base, range, type) → String or Array<Integer> or Array<Float>
Parameters:
- rng [Object] — a random number generator
- base [Integer] — the base value to randomize from
- range [Integer] — the maximum value in a randomized range starting at 0
- type [Symbol] — the type of color specification to return
Returns:
- [String or Array<Integer> or Array<Float>] — an integer array color specification of the random color
typeof_cmyk_cspec(cspec) → Symbol
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Symbol] — the type of color specification { :hashstring, :integers, :floats }
typeof_cmyka_cspec(cspec) → Symbol
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Symbol] — the type of color specification { :hashstring, :integers, :floats }
typeof_rgb_cspec(cspec) → Symbol
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Symbol] — the type of color specification { :hashstring, :integers, :floats }
typeof_rgba_cspec(cspec) → Symbol
Parameters:
- cspec [String or Array<Integer> or Array<Float>] — the color specification to check
Returns:
- [Symbol] — the type of color specification { :hashstring, :integers, :floats }
Class: PixMill::CompositeDrawingContext
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/composites.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
Constructor Registry
Method Registry
Constructor Details
new(dc_vector)
Parameters:
- dc_vector [Array<DrawingContext>] — the array of (Cairo) DrawingContexts to manage in a composite canvas
Method Details
[](nth) → DrawingContext
Parameters:
- nth [Integer] — the index of the pango layout vector
Returns:
- [DrawingContext] — the specific DrawingContext requested from the collection
create_font_layout → CompositePangoInfo
This method creates a composite font layout to cover the composite DrawingContext collection.Returns:
- [CompositePangoInfo] — a composite font layout to cover the DrawingContext collection
current_point
This method implements the current_point API to cover all of the DrawingContexts in the collection.font_layout_path
This method implements the font_layout_path API call to all of the DrawingContexts in the collection.method_missing <api>
This special Ruby method dispatches method calls to all of the DrawingContexts in the collection as if it was sent to a single specific one.path_extents → Hash
This method returns information related to the composite DrawingContext area.Returns:
- [Hash] — extent information for the region covered by the DrawingContext set
show_font_layout
This method implements the show_font_layout API call to all of the DrawingContexts in the collection.update_font_layout
This method implements the update_font_layout API call to all of the DrawingContexts in the collection.Class: PixMill::CompositePangoInfo
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/composites.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
Constructor Registry
Method Registry
Constructor Details
new(layout_vector)
Parameters:
- layout_vector [Array<Pango::Layout>] — the array of Pango layout contexts to manage in a composite canvas
Method Details
[](nth) → Pango::Layout
Parameters:
- nth [Integer] — the index of the pango layout vector
Returns:
- [Pango::Layout] — a specific Pango layout context within the array
extents → Hash
This method returns information related to the composite Pango layout area.Returns:
- [Hash] — extent information for the region covered by the Pango layout context set
method_missing <api>
This special Ruby method dispatches method calls to all of the Pango layouts in the collection as if it was sent to a single specific one.Class: PixMill::DataTable ← PixMill::Rectangle
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A DataTable is simply a Rectangle with assigned callbacks to handle the table layout and cell content. Content gets rendered during the draw method.
Constructor Registry
Method Registry
Constructor Details
new(parent, w, h, layout, content, scale, gs)
The CallbackRegion ConstructorParameters:
- parent [MarkingObject] — the parent of the callback rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- layout [Hash] — the information needed to handle the table layout
- content [Hash] — the information needed to handle the data content
- scale [Integer] — the user unit scale of the rectangle (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
cliptrace(gs, force_placement) → CallbackRegion
Trace the callback rectangle's area onto the object heirarchy foundation for clipping purposesParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [CallbackRegion] — the current callback region object
draw(gs) → CallbackRegion
Draw the callback region content into the layout areaParameters:
- gs [GraphicsState] — the graphics state to use to color the object
Returns:
- [CallbackRegion] — the current callback region object
set(parent, w, h, layout, content, scale, gs) → CallbackRegion
Set the callback's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the callback rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- layout [Hash] — the information needed to handle the table layout
- content [Hash] — the information needed to handle the data content
- scale [Integer] — the user unit scale of the rectangle (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [CallbackRegion] — the current callback region object
trace
Override the MarkingObject.trace methodClass: PixMill::Ellipse ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
An Ellipse is a curved object defined and bounded by its radii.
Constructor Registry
Method Registry
Constructor Details
new(parent, xr, yr, scale, gs)
The Ellipse ConstructorParameters:
- parent [MarkingObject] — the parent of the ellipse
- xr [Numeric] — the x-axis radius of the ellipse
- yr [Numeric] — the y-axis radius of the ellipse
- scale [Integer] — the user unit scale of the ellipse (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
place(gs) → Ellipse
Place the ellipse using the radii layoutParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [Ellipse] — the current ellipse
set(parent, xr, yr, scale, gs) → Ellipse
Set the ellipse's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the ellipse
- xr [Numeric] — the x-axis radius of the ellipse
- yr [Numeric] — the y-axis radius of the ellipse
- scale [Integer] — the user unit scale of the ellipse (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Ellipse] — the current ellipse
trace(gs, force_placement) → Ellipse
Trace the ellipse's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Ellipse] — the current ellipse
Class: PixMill::GraphicsState
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/graphicsstate.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This class is the interface layer and graphics state manager for PixMill and handles all interactions between PixMill and the underlying Cairo and Pango libraries.
Constructor Registry
Class Method Registry
Constant Registry
Method Registry
Attribute Registry
Constructor Details
new(dc, width, height, ctab)
Parameters:
- dc [DrawingContext] — the (Cairo) drawing context to assign to the canvas
- width [Integer] — the width of the canvas
- height [Integer] — the height of the canvas
- ctab [ColorTable] — the color table to use with the canvas, nil = default
Class Method Details
register
The purpose of this is/was to minimize the number of GS instances floating aroundConstant Details
DEFAULT_CTAB <read-only>
GRAVITIES <read-only>
LAYOUTS <read-only>
Method Details
[](index) → Value
The property access methodParameters:
- index [Symbol] — the property to access
Returns:
- [Value] — the value of the property
clipto(preserve) → GraphicsState
Creates a clip region based on the current context's path and pushes it onto the context's stackParameters:
- preserve [Boolean] — maintains the current path after the operation
Returns:
- [GraphicsState] — the current graphics state instance
config_pattern_spec(pinfo) → Array <private>
This private method is used to set the mapping matrix for a given pattern.Parameters:
- pinfo [Hash] — the pattern and its associated metadata
Returns:
- [Array] — a 2-element array containing the pattern object and its auto_anchor value
config_source(index, value) <private>
This private method is used to set the fill properties of the specified source. It does this by setting some DrawingContext interface variables, xxtype and xxsource, where 'xx' is the first 2 characters of the specified index. The legal indices are: :fill, :stroke, :source, :text, :background and :mask.Parameters:
- index [Symbol] — the name of the graphics state property to set
- value [Value] — the value of the graphics state property to set
gen_canvas_bbox(w, h, ctm) → Array<Number> <private>
This private method calculates the current bounding box of the canvas given its current width, height and ctm.Parameters:
- w [Number] — the current width of the canvas
- h [Number] — the current height of the canvas
- ctm [] — the current transformation matrix applied to the canvas
Returns:
- [Array<Number>] — the bounding box of the canvas
get_native_color(value) → NativeColor
This method returns the NativeColor representation of the specified color value. Supplied values can be cspec strings or numeric arrays or symbols into the current color table. This method is a good way to funnel all the different color specification formats into a known format.Parameters:
- value [Symbol,String,Array] — the specified color value
Returns:
- [NativeColor] — the NativeColor representation of the specified color value
is_east? → Boolean
Is the current gravity setting to the eastReturns:
- [Boolean] — true if the current gravity setting is NE, E or SE
is_north? → Boolean
Is the current gravity setting to the northReturns:
- [Boolean] — true if the current gravity setting is NW, N or NE
is_south? → Boolean
Is the current gravity setting to the southReturns:
- [Boolean] — true if the current gravity setting is SW, S or SE
is_west? → Boolean
Is the current gravity setting to the westReturns:
- [Boolean] — true if the current gravity setting is NW, W or SW
paint → GraphicsState
Paints the current context using the fill source (path-independent)Returns:
- [GraphicsState] — the current graphics state
pop(n) → GraphicsState
Pops a previous copy of the GS into the GS from the StackParameters:
- n [Integer] — pops N copies
Returns:
- [GraphicsState] — the current graphics state
pop! → GraphicsState
Pops all copies of the GS into the GS from the StackReturns:
- [GraphicsState] — the current graphics state
push → GraphicsState
Pushes a copy of the GS onto the Stack for later retrieval via popReturns:
- [GraphicsState] — the current graphics state
resetclip → GraphicsState
Pops all clip regions from the context's stackReturns:
- [GraphicsState] — the current graphics state instance
restore_path
save_path
set(props) → GraphicsState
The property assignment method. Order can be important here, such as setting :origin and :rotationParameters:
- props [Hash] — the properties to set
Returns:
- [GraphicsState] — the current graphics state
set_line_props(dc, width) <private>
This private method sets the line properties of the underlying drawing context.Parameters:
- dc [DrawingContext] — the underlying drawing context
- width [Number] — the line width
set_pattern_gravity_matrix(dc, pattern, gravity) <private>
This private method sets the pattern's matrix based on a gravity well within the dimensions of the drawing context.Parameters:
- dc [DrawingContext] — the underlying drawing context
- pattern [Pattern] — the pattern to use
- gravity [Symbol] — the gravity value
stroke_fill(preserve) → GraphicsState
Fills and strokes the current context path using the fill & stroke sourcesParameters:
- preserve [Boolean] — maintains the current path after the operation
Returns:
- [GraphicsState] — the current graphics state
unclip → GraphicsState
Pops the current clip region from the context's stackReturns:
- [GraphicsState] — the current graphics state instance
Attribute Details
ctab
dc
Class: PixMill::Hexagon ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A hexagon is a six-sided polygon object defined and bounded by its orientation and edge-to-edge size.
Constructor Registry
Method Registry
Constructor Details
new(parent, size, orientation, scale, gs)
The Hexagon ConstructorParameters:
- parent [MarkingObject] — the parent of the hexagon
- size [Numeric] — the edge-to-edge size of the hexagon
- orientation [Symbol] — the orientation of the hexagon: { :wide, :tall }
- scale [Integer] — the user unit scale of the hexagon (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
place(gs) → Hexagon
Place the hexagon using the hexagon layoutParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [Hexagon] — the current hexagon
set(parent, size, orientation, scale, gs) → Hexagon
Set the hexagon's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the hexagon
- size [Numeric] — the edge-to-edge size of the hexagon
- orientation [Symbol] — the orientation of the hexagon: { :wide, :tall }
- scale [Integer] — the user unit scale of the hexagon (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Hexagon] — the current hexagon
trace(gs, force_placement) → Hexagon
Trace the hexagon's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Hexagon] — the current hexagon
Class: PixMill::Image ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
The PixMill::Image class
Constructor Registry
Method Registry
Constructor Details
new(parent, surface, scale, gs)
The Image ConstructorParameters:
- parent [MarkingObject] — the parent of the path
- surface [Surface] — the image to draw/render
- scale [Integer] — the user unit scale of the text layout position (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
bbox → BoundingBox or Nil
The bbox method, which is used to return the bounding box of the object within the object heirarchyReturns:
- [BoundingBox or Nil] — the bounding box of the object
cliptrace(gs, force_placement) → Image
Trace the image object's area onto the object heirarchy foundation for clipping purposesParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Image] — the current image object
draw(gs) → Image
Draw the image into the layout areaParameters:
- gs [GraphicsState] — the graphics state to use to color the object
Returns:
- [Image] — the current image object
place(gs) → Image
Place the object using Pango infromationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [Image] — the current image object
set(parent, surface, scale, gs) → Image
Set the path's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the path
- surface [Surface] — the image to draw/render
- scale [Integer] — the user unit scale of the text layout position (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Image] — the current image object
trace
Override the MarkingObject.trace methodClass: PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A note about the default trinity of place, trace and draw methods. The order of ops is: - place the object onto the canvas (sets layout) - trace the object's path (relies on the layout; vector objects only; can call place if need be) - draw the object using its path (relies on the object's path trace; can call place or trace if need be) - errors are handled via thrown exceptions, whether soft or hard - the draw method can supply an exception handler to catch soft errors
Method Registry
Attribute Registry
Method Details
bbox → BoundingBox or Nil
The bbox method, which is used to return the bounding box of the object within the object heirarchyReturns:
- [BoundingBox or Nil] — the bounding box of the object
calc_dim(scale, value) <private>
Parameters:
- scale [Number] — the scale factor to use
- value [Number] — the source value to calculate from
clipto(gs) → MarkingObject
The clipto method, which is used to clip output operations to a specific MarkingObjectParameters:
- gs [GraphicsState] — the graphics state to use for setting the clip stack
Returns:
- [MarkingObject] — the current MarkingObject instance
cliptrace(gs, force_placement) → MarkingObject
The cliptrace method, which is used by objects to trace the path of the object's clipping region Non-vector-based objects will probably trace a bounding box rectangleParameters:
- gs [GraphicsState] — the GraphicsState to use to place the object
- force_placement [Boolean] — calls place if true
Returns:
- [MarkingObject] — the current MarkingObject instance
draw(gs) → MarkingObject
The draw method, which is used to draw or paint the object onto the underlying canvas or crParameters:
- gs [GraphicsState] — the GraphicsState to use to place the object
Returns:
- [MarkingObject] — the current MarkingObject instance
parent_is_base? → Boolean <private>
This method will return true if the MarkingObject is a DrawingContextReturns:
- [Boolean] — true if the parent is the base of the object hierarchy
parent_is_viewport? → Boolean
An interrogator method, which is used to determine if the MarkingObject is a Viewport Viewports are boundless and have special properties.Returns:
- [Boolean] — true if the MarkingObject is a Viewport
place(gs) → MarkingObject
The place method, which is used to place the object within the object heirarchy. This method sets the layout properties of the MarkingObjectParameters:
- gs [GraphicsState] — the GraphicsState to use to place the object
Returns:
- [MarkingObject] — the current MarkingObject instance
reparent(parent, gs) → MarkingObject
The reparent method, which is used to set a new parent for an objectParameters:
- parent [MarkingObject] — the new parent for the MarkingObject
- gs [GraphicsState] — the graphics state to use to set the new placement
Returns:
- [MarkingObject] — the current MarkingObject instance
set(type, parent, scale, props) → MarkingObject
The set method which handles the foundation data and properties for each MarkingObjectParameters:
- type [Symbol] — the type of object
- parent [MarkingObject or DrawingContext] — the parent of the MarkingObject
- scale [Integer] — the unit scale of the MarkingObject
- props [Array<Mixed>] — the additional object-specific properties of the MarkingObject
Returns:
- [MarkingObject] — the current MarkingObject instance
set_hexagon_layout(gs, ee, orientation) → MarkingObject <private>
Set the layout parameters for a hexagonParameters:
- gs [GraphicsState] — the current graphics state
- ee [Numeric] — the edge-to-edge size of the hexagon
- orientation [Symbol] — the orientation of the hexagon: { :wide, :tall }
Returns:
- [MarkingObject] — the current MarkingObject instance
set_image_layout(gs, surface) → MarkingObject <private>
Set the layout parameters for an imageParameters:
- gs [GraphicsState] — the current graphics state
- surface [Surface] — the Cairo surface containing the image data
Returns:
- [MarkingObject] — the current MarkingObject instance
set_poly_layout(gs, minmax) → MarkingObject <private>
Set the layout parameters for a polygonParameters:
- gs [GraphicsState] — the current graphics state
- minmax [Array<Numeric>] — the minimum and maximum x and y coordinates of the polygon
Returns:
- [MarkingObject] — the current MarkingObject instance
set_radii_layout(gs, xr, yr) → MarkingObject <private>
Set the layout parameters for an object defined by one or two radiiParameters:
- gs [GraphicsState] — the current graphics state
- xr [Numeric] — the radius along the x axis
- yr [Numeric] — the radius along the y axis (optional)
Returns:
- [MarkingObject] — the current MarkingObject instance
set_text_layout(gs, font_layout, snap_to_ink) → MarkingObject <private>
Set the layout parameters for a text objectParameters:
- gs [GraphicsState] — the current graphics state
- font_layout [Pango::Layout] — the Pango layout object
- snap_to_ink [Boolean] — true if we are snapping the layout to the ink extents
Returns:
- [MarkingObject] — the current MarkingObject instance
set_wh_layout(gs, w, h) → MarkingObject <private>
Set the layout parameters for an object defined by width/height parametersParameters:
- gs [GraphicsState] — the current graphics state
- w [Numeric] — the width of the object
- h [Numeric] — the height of the object
Returns:
- [MarkingObject] — the current MarkingObject instance
trace(gs, force_placement) → MarkingObject
The trace method, which is used by vector-based objects to trace the path of the objectParameters:
- gs [GraphicsState] — the GraphicsState to use to place the object
- force_placement [Boolean] — calls place if true
Returns:
- [MarkingObject] — the current MarkingObject instance
unclip(gs) → MarkingObject
The clipto method, which is used to clip output operations to a specific MarkingObjectParameters:
- gs [GraphicsState] — the graphics state to use for popping the clip stack
Returns:
- [MarkingObject] — the current MarkingObject instance
update(props) → MarkingObject
The update method, which is used to reset an object's propertiesParameters:
- props [Array<Mixed>] — the object-specific properties of the MarkingObject
Returns:
- [MarkingObject] — the current MarkingObject instance
viewport → Viewport
The viewport method, which is used to return the viewport underlying the object heirarchy.Returns:
- [Viewport] — the viewport
Attribute Details
dc
layout
parent
props
scale
type
Class: PixMill::PangoText ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
The PangoText class is designed as a common text base class for TextPath and Text. It defines the Cairo/Pango layout interaction and should not be used by anyone directly.
Constructor Registry
Method Registry
Constructor Details
new(parent, string, attr_list, scale, fontscale, snap_to_ink)
The PangoText ConstructorParameters:
- parent [MarkingObject] — the parent of the path
- string [String] — the text string to draw/render
- attr_list [TextAttributeList] — the attribute list to apply to the string (optional)
- scale [Integer] — the user unit scale of the text layout position (optional)
- fontscale [Integer] — the user unit scale of the font size to use (optional)
- snap_to_ink [Boolean] — true if the layout area should only include the inked portion (optional)
Method Details
bbox → BoundingBox or Nil
The bbox method, which is used to return the bounding box of the object within the object heirarchyReturns:
- [BoundingBox or Nil] — the bounding box of the object
cliptrace
Override the MarkingObject.cliptrace methodgen_font_layout(gs) <private>
Parameters:
- gs [GraphicsState] — the graphics state to use to generate the font layout
load_font_attributes <private>
place(gs) → PangoText
Place the object using Pango infromationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [PangoText] — the current pango text object
set(type, parent, string, attr_list, scale, fontscale, snap_to_ink) → PangoText
Set the text object's foundation data and propertiesParameters:
- type [Symbol] — the type of text object: { :textpath, :text }
- parent [MarkingObject] — the parent of the path
- string [String] — the text string to draw/render
- attr_list [TextAttributeList] — the attribute list to apply to the string (optional)
- scale [Integer] — the user unit scale of the text layout position (optional)
- fontscale [Integer] — the user unit scale of the font size to use (optional)
- snap_to_ink [Boolean] — true if the layout area should only include the inked portion (optional)
Returns:
- [PangoText] — the current pango text object
trace(gs, force_placement) → PangoText
Trace the text object's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [PangoText] — the current pango text object
Class: PixMill::Path ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A path is an object defined and bounded by its path descriptor.
Constructor Registry
Method Registry
Constructor Details
new(parent, desc, scale, gs)
The Path ConstructorParameters:
- parent [MarkingObject] — the parent of the path
- desc [String] — the string descriptor of the path
- scale [Integer] — the user unit scale of the polygon (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
place(gs) → Path
Place the path using path extents and the poly layoutParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [Path] — the current path
set(parent, desc, scale, gs) → Path
Set the path's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the path
- desc [String] — the string descriptor of the path
- scale [Integer] — the user unit scale of the polygon (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Path] — the current path
trace(gs, force_placement) → Path
Trace the path's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Path] — the current path
trace_the_path(dc, origin) <private>
Trace the path within the foundation context based on its position in the object hierarchyParameters:
- dc [DrawingContext] — the underlying drawing context to trace the path onto
- origin [Array<Numeric>] — the x,y origin settings for path tracing
Class: PixMill::PathDescriptor
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/pathdescriptor.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
SVG-style path descriptor parsing
Constructor Registry
Class Method Registry
Method Registry
Attribute Registry
Constructor Details
new(desc)
The PathDescriptor initializerParameters:
- desc [String] — the SVG-style path descriptor
Class Method Details
crpath_to_desc(dc, use_relative_coords, separate_into_subpaths) → String or Nil
Path Constructor Helper Method: Build a descriptor from the current Cairo pathParameters:
- dc [DrawingContext] — the (Cairo) drawing context with the current path
- use_relative_coords [Boolean] — true if a relative descriptor is wanted
- separate_into_subpaths [Boolean] — true if an array of subpaths is wanted
Returns:
- [String or Nil] — the derived PathDescriptor or nil on error
h(x, y, dx, rel) → String
Path Constructor Helper Method: Horizontal LineParameters:
- x [Numeric] — the x coordinate where to start the line
- y [Numeric] — the y coordinate where to start the line
- dx [Numeric] — the length of the line
- rel [Boolean] — true if the start location is relative from a previous path location
Returns:
- [String] — the string descriptor of the path
join <private>
l(x, y, dx, dy, rel) → String
Path Constructor Helper Method: LineParameters:
- x [Numeric] — the x coordinate where to start the line
- y [Numeric] — the y coordinate where to start the line
- dx [Numeric] — the x-axis length of the line
- dy [Numeric] — the y-axis length of the line
- rel [Boolean] — true if the start location is relative from a previous path location
Returns:
- [String] — the string descriptor of the path
m <private>
r(x, y, w, h, rel) → String
Path Constructor Helper Method: RectangleParameters:
- x [Numeric] — the x coordinate where to place the rectangle
- y [Numeric] — the y coordinate where to place the rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- rel [Boolean] — true if the start location is relative from a previous path location
Returns:
- [String] — the string descriptor of the path
rbody <private>
rr(x, y, w, h, rx, ry, rel) → String
Path Constructor Helper Method: Rounded RectangleParameters:
- x [Numeric] — the x coordinate where to place the rectangle
- y [Numeric] — the y coordinate where to place the rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- rx [Numeric] — the horizontal radius of the corners
- ry [Numeric] — the vertical radius of the corners
- rel [Boolean] — true if the start location is relative from a previous path location
Returns:
- [String] — the string descriptor of the path
rrbody <private>
v(x, y, dy, rel) → String
Path Constructor Helper Method: Vertical LineParameters:
- x [Numeric] — the x coordinate where to start the line
- y [Numeric] — the y coordinate where to start the line
- dy [Numeric] — the length of the line
- rel [Boolean] — true if the start location is relative from a previous path location
Returns:
- [String] — the string descriptor of the path
Method Details
any_tokens? → Boolean
Are there any tokens in the tokens list?Returns:
- [Boolean] — true if there is a valid token list
compile → Boolean <private>
Compile the given SVG-style path descriptor into component partsReturns:
- [Boolean] — true if the path descriptor compiled cleanly
meshtrace(pattern, abs_x, abs_y, rel_x, rel_y)
Trace the path within a MeshPattern patchParameters:
- pattern [Cairo::MeshPattern] — the mesh pattern to trace the path within
- abs_x [Lambda] — a conversion lambda for absolute x coordinate data
- abs_y [Lambda] — a conversion lambda for absolute y coordinate data
- rel_x [Lambda] — a conversion lambda for relative x coordinate data
- rel_y [Lambda] — a conversion lambda for relative y coordinate data
set(desc) → Boolean
Set the PathDescriptor to a new SVG-style descriptorParameters:
- desc [String] — the SVG-style path descriptor
Returns:
- [Boolean] — true if the new descriptor compiled cleanly and there are tokens to be processed
trace(dc, abs_x, abs_y, rel_x, rel_y)
Trace the path in a Cairo contextParameters:
- dc [DrawingContext] — the drawing context to trace the path within
- abs_x [Lambda] — a conversion lambda for absolute x coordinate data
- abs_y [Lambda] — a conversion lambda for absolute y coordinate data
- rel_x [Lambda] — a conversion lambda for relative x coordinate data
- rel_y [Lambda] — a conversion lambda for relative y coordinate data
Attribute Details
desc
tokens
Class: PixMill::PathEngine
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/pathengine.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
An engine to draw paths onto a DrawingContext using shorthand / assembler type instructions
Constructor Registry
Method Registry
Attribute Registry
Constructor Details
new(gs, context)
Parameters:
- gs [GraphicsState] — the graphics state to draw the paths onto
- context [Context] — the Ruby language domain context to parse instructions from
Method Details
circle <private>
clipto
sets a clipping region within the current graphics statedispatch(op, args) <private>
The Instruction Dispatcher, PathEngine's beating heartParameters:
- op [Numeric] — the operation to parse and operate on
- args [Array<Mixed>] — the arguments to the operation, depends on the operation being handled
dx(dx)
This method draws a horizontal line.Parameters:
- dx [Numeric] — the length of the horizontal line to draw
dxy(dx, dy)
This family of methods draws a line from the current point to a point dx,dy units away.Parameters:
- dx [Numeric] — the horizontal offset of the destination point of the line
- dy [Numeric] — the vertical offset of the destination point of the line
dy(dy)
This family of methods draws a vertical line.Parameters:
- dy [Numeric] — the length of the vertical line to draw
earc_check <private>
ellipse <private>
ellipse_check <private>
flush
flushes pending stroke/fill operationsmethod_missing <private>
pop
pops the current graphics state and path engine flush flag for subsequent processingpush
pushes the current graphics state and path engine flush flag for subsequent processing in a new environmentqpath(nquads, radius, pts, dir)
Parameters:
- nquads [Integer] — the number of quadrants to draw
- radius [Numeric] — the radius around the circle to draw at
- pts [Hash or Array] — a set of points to transform
- dir [Symbol] — the direction around the circle to do the drawing { :cw, :ccw }
run(block)
launches the DSL (Domain-Specific Language) contextParameters:
- block [Block] — a Ruby code block that will host the DSL
setff
sets the "path engine flush flag" valuesetgs
modifies the attached graphics stateAttribute Details
gs
Class: PixMill::Polygon ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A polygon is an object defined and bounded by its vertex list.
Constructor Registry
Method Registry
Constructor Details
new(parent, pts, closed, scale, gs)
The Polygon ConstructorParameters:
- parent [MarkingObject] — the parent of the polygon
- pts [Array<Numeric>] — the xy coordinate list of the polygon
- closed [Boolean] — the end path status of the polygon, true if closed
- scale [Integer] — the user unit scale of the polygon (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
place(gs) → Polygon
Place the polygon using the poly layoutParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [Polygon] — the current polygon
set(parent, pts, closed, scale, gs) → Polygon
Set the polygon's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the polygon
- pts [Array<Numeric>] — the xy coordinate list of the polygon
- closed [Boolean] — the end path status of the polygon, true if closed
- scale [Integer] — the user unit scale of the polygon (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Polygon] — the current polygon
trace(gs, force_placement) → Polygon
Trace the polygon's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Polygon] — the current polygon
xyvec → Array<Numeric> <private>
Calculate the polygon's vertex list in relation to its parentReturns:
- [Array<Numeric>] — the adjusted vertices of the hexagon
Class: PixMill::Rectangle ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A Rectangle is a quadrilateral object defined and bounded by its width and height. A rounded rectangle also has radii properties that define its corners
Constructor Registry
Method Registry
Constructor Details
new(parent, w, h, xr, yr, scale, gs)
The Rectangle ConstructorParameters:
- parent [MarkingObject] — the parent of the rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- xr [Numeric] — the horizontal radius of the rectangle's rounded corners (optional)
- yr [Numeric] — the vertical radius of the rectangle's rounded corners (optional)
- scale [Integer] — the user unit scale of the rectangle (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
place(gs) → Rectangle
Place the rectangle using the wh layoutParameters:
- gs [GraphicsState] — the graphics state to use to place the object
Returns:
- [Rectangle] — the current rectangle
set(parent, w, h, xr, yr, scale, gs) → Rectangle
Set the rectangle's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the rectangle
- w [Numeric] — the width of the rectangle
- h [Numeric] — the height of the rectangle
- xr [Numeric] — the horizontal radius of the rectangle's rounded corners (optional)
- yr [Numeric] — the vertical radius of the rectangle's rounded corners (optional)
- scale [Integer] — the user unit scale of the rectangle (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Rectangle] — the current rectangle
trace(gs, force_placement) → Rectangle
Trace the rectangle's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Rectangle] — the current rectangle
xywhrr → Array<Numeric> <private>
Calculate the rectangle's rounded corner parameters when tracing itReturns:
- [Array<Numeric>] — the x, y, w, h and radii parameters to use when tracing the rounded rectangle
Class: PixMill::Shader
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/shader.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This class is an interface class that will contain and classify Gouraud, Coons and Tensor mesh pattern shaders, as supported by the Cairo library.
Constructor Registry
Method Registry
Constructor Details
new(dict)
This class constructor may be used to convert a given mesh pattern dictionary into a Shader object or it may be used to create a blank pattern for dynamic creation.Parameters:
- dict [Hash or Nil] — the dictionary containing the shader information regarding type and colors
- :type [Symbol] — the type of dictionary
- :triangles [Array<Array<Float>>] — the array of 3-element color vertex array (if :type == :triangles)
Method Details
process_dict(dict) → Shader <private>
This method processes the specified shader dictionary and sets the internal Shader operating parameters.Parameters:
- dict [Hash] — the dictionary containing the shader information regarding type and colors
- :type [Symbol] — the type of dictionary
- :triangles [Array<Array<Float>>] — the array of 3-element color vertex array (if :type == :triangles)
Returns:
- [Shader] — the Shader instance
Class: PixMill::Text ← PixMill::PangoText
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This class is uses a simplified API and differs from TextPath in that: - trace operations are not supported - the use of TextAttributeLists are not supported - it relies on Pango's markup text extensions to support attributes - text colors are used, not fill (important distinction!)
Constructor Registry
Method Registry
Constructor Details
new(parent, string, scale, fontscale, snap_to_ink, gs)
The TextPath ConstructorParameters:
- parent [MarkingObject] — the parent of the path
- string [String] — the text string to draw/render
- scale [Integer] — the user unit scale of the text layout position (optional)
- fontscale [Integer] — the user unit scale of the font size to use (optional)
- snap_to_ink [Boolean] — true if the layout area should only include the inked portion (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
cliptrace(gs, force_placement) → Text
Trace the text object's area onto the object heirarchy foundation for clipping purposesParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [Text] — the current text object
draw(gs) → Text
Draw the text stream into the layout areaParameters:
- gs [GraphicsState] — the graphics state to use to color the object
Returns:
- [Text] — the current text object
set(parent, string, scale, fontscale, snap_to_ink, gs) → Text
Set the Text's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the path
- string [String] — the text string to draw/render
- scale [Integer] — the user unit scale of the text layout position (optional)
- fontscale [Integer] — the user unit scale of the font size to use (optional)
- snap_to_ink [Boolean] — true if the layout area should only include the inked portion (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [Text] — the current text object
trace
Override the MarkingObject.trace methodClass: PixMill::TextAttributeList
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/textattributelist.rb | Ruby | Kenneth F. Guerin | Copyright © 2017-2021, Kenneth F. Guerin, all rights reserved. |
Overview
Constructor Registry
Method Registry
Constructor Details
new
Method Details
add_background(value, si, ei) → TextAttributeList
Parameters:
- value [PaintSpecification] — the paint specification
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_fill(value, si, ei) → TextAttributeList
Parameters:
- value [PaintSpecification] — the paint specification
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_font_style(value, si, ei) → TextAttributeList
Parameters:
- value [Numeric] — the scale factor to apply to the base font size of the string
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_font_variant(value, si, ei) → TextAttributeList
Parameters:
- value [Symbol] — the variant to apply to the string
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_rise(value, si, ei) → TextAttributeList
Parameters:
- value [Numeric] — the scale factor to apply to the vertical placement of the string, based on the font size
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_stretch(value, si, ei) → TextAttributeList
Parameters:
- value [Symbol] — the stretch attribute to apply to the string
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_strikethrough(si, ei) → TextAttributeList
Parameters:
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_strikethrough_color(value, si, ei) → TextAttributeList
Parameters:
- value [PaintSpecification] — the paint specification
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_stroke(value, si, ei) → TextAttributeList
Parameters:
- value [PaintSpecification] — the paint specification
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_stroke_width(value, si, ei) → TextAttributeList
Parameters:
- value [Numeric] — the paint specification
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_subscript(value, si, ei) → TextAttributeList
Parameters:
- value [Integer] — the subscript level the string, where 1 is the first subscript level
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_superscript(value, si, ei) → TextAttributeList
Parameters:
- value [Integer] — the superscript level the string, where 1 is the first superscript level
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_underline(value, si, ei) → TextAttributeList
Parameters:
- value [Symbol] — the type of underline to apply to the string
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_underline_color(value, si, ei) → TextAttributeList
Parameters:
- value [PaintSpecification] — the paint specification
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
add_weight(value, si, ei) → TextAttributeList
Parameters:
- value [Numeric or Symbol] — the weight factor to apply to the string
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
any_drawing_attributes? → Boolean
Returns:
- [Boolean] — if there are any drawing attributes
any_layout_attributes? → Boolean
Returns:
- [Boolean] — if there are any layout attributes
collect_drawing_attributes → TextAttributeList
Returns:
- [TextAttributeList] — the current text attributes list
each_layout_attribute → TextAttributeList
Returns:
- [TextAttributeList] — the current text attributes list
lenadd_font_rel_sizegth(value, si, ei) → TextAttributeList
Parameters:
- value [Numeric] — the scale factor to apply to the base font size of the string
- si [Integer] — the starting index within the string to apply the attribute
- ei [Integer] — the ending index within the string to apply the attribute
Returns:
- [TextAttributeList] — the current text attributes list
length → Integer
Returns:
- [Integer] — the size of the combined attribute lists
length
Class: PixMill::TextPath ← PixMill::PangoText
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This class differs from Text in that: - background fill operations are not supported. - snap-to-ink is always enabled as we're not as interested with doing text display layout - trace operations are real - fill colors are used, not text (important distinction!) - embedded markup is not supported
Constructor Registry
Method Registry
Constructor Details
new(parent, string, scale, fontscale, gs)
The TextPath ConstructorParameters:
- parent [MarkingObject] — the parent of the path
- string [String] — the text string to draw/render
- scale [Integer] — the user unit scale of the text layout position (optional)
- fontscale [Integer] — the user unit scale of the font size to use (optional)
- gs [GraphicsState] — the graphics state to use to place the object on initialization (optional)
Method Details
cliptrace(gs, force_placement) → TextPath
Trace the text object's clipping path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [TextPath] — the current text path
draw(gs) → TextPath
Draw the text path into the layout areaParameters:
- gs [GraphicsState] — the graphics state to use to color the object
Returns:
- [TextPath] — the current text object
set(parent, string, scale, fontscale, gs) → TextPath
Set the TextPath's foundation data and propertiesParameters:
- parent [MarkingObject] — the parent of the path
- string [String] — the text string to draw/render
- scale [Integer] — the user unit scale of the text layout position (optional)
- fontscale [Integer] — the user unit scale of the font size to use (optional)
- gs [GraphicsState] — the graphics state to use to place the object (optional)
Returns:
- [TextPath] — the current text path
trace(gs, force_placement) → TextPath
Trace the text object's path onto the object heirarchy foundationParameters:
- gs [GraphicsState] — the graphics state to use to place the object
- force_placement [Boolean] — true to re-place the object
Returns:
- [TextPath] — the current text path
Class: PixMill::Viewport ← PixMill::MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/markingobjects.rb | Ruby | Kenneth F. Guerin | Copyright © 2018-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A Viewport is a dimensionless object that sits at some offset from context's origin. This offset is usually 0,0, but can be changed. Viewports are designed to be root objects in the MarkingObject stack. As such, viewport's parents must be CRs: DrawingContexts or CompositeDrawingContexts.
Constructor Registry
Method Registry
Constructor Details
new(parent, x, y)
The Viewport ConstructorParameters:
- parent [DrawingContext or CompositeDrawingContext] — the parent of the viewport
- x [Integer] — the horizontal offset of the viewport's origin
- y [Integer] — the vertical offset of the viewport's origin
Method Details
bbox → BoundingBox
Return the viewport's bounding boxReturns:
- [BoundingBox] — the bounding box of the viewport
set(parent, x, y) → Viewport
Set the viewport's foundation data and propertiesParameters:
- parent [DrawingContext or CompositeDrawingContext] — the parent of the viewport
- x [Integer] — the horizontal offset of the viewport's origin within the parent's coordinate space
- y [Integer] — the vertical offset of the viewport's origin within the parent's coordinate space
Returns:
- [Viewport] — the current viewport
Cruby: PixMill
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/init.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
Function: PixMill::Init_pixmill
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/init.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This function creates the PixMill Ruby module and initializes / requires various subclasses within it.
The following subclasses are created and/or loaded into the PixMill module space: - PixMill::NativeColor - PixMill::Surface (C/Cairo) - PixMill::Pattern (C/Cairo) - PixMill::DrawingContext (C/Cairo) - PixMill::FontDescription (C/Pango) - PixMill::FontLayout (C/Pango) - PixMill::FontLayoutIter (C/Pango) - PixMill::FontAttributeList (C/Pango) - PixMill::Canvas (C) - PixMill::Composites (Ruby) - PixMill::ColorTools (Ruby) - PixMill::ColorTable (Ruby) - PixMill::Shader (Ruby) - PixMill::GraphicsState (Ruby) - PixMill::BoundingBox (Ruby) - PixMill::TextAttibuteList (Ruby) - PixMill::PathDescriptor (Ruby) - PixMill::PathEngine (Ruby) - PixMill::MarkingObjects (Ruby)
Cruby: PixMill::Canvas
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/canvas.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
Function: PixMill::Canvas::rb_canvas_flip ⟼ flip
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/canvas.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This function flips the contents of the PixMill::Canvas object.
Function: PixMill::Canvas::rb_canvas_initialize ⟼ initialize
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/canvas.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This function implements the PixMill::Canvas constructor.
Function: PixMill::Canvas::rb_canvas_rootbox ⟼ rootbox
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/canvas.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This function returns the rootbox of the PixMill::Canvas object.
Function: PixMill::Canvas::rb_canvas_save ⟼ save
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/canvas.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
This function exports the contents of the PixMill::Canvas object as one or more image files.
Cruby: PixMill::DrawingContext
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/cairo-context.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A functional interface to cairo_t* and associated data.
Cruby: PixMill::FontAttributeList
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/pango-attrlist.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A functional interface to PangoAttrList* and associated data.
Cruby: PixMill::FontDescription
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/pango-fontdesc.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A functional interface to PangoFontDescription* and associated data.
Cruby: PixMill::FontLayout
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/pango-layout.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A functional interface to PangoLayout* and associated data.
Cruby: PixMill::FontLayoutIter
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/pango-iter.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A functional interface to PangoLayoutIter* and associated data.
Cruby: PixMill::NativeColor
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/ncolor.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A native definition of color definitions used by Cairo.
Cruby: PixMill::Pattern
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/cairo-pattern.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A functional interface to cairo_pattern_t* and associated data.
Cruby: PixMill::Surface
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| ext/pixmill/cairo-surface.c | C | Kenneth F. Guerin | Copyright © 2020-2021, Kenneth F. Guerin, all rights reserved. |
Overview
A functional interface to cairo_surface_t* and associated data.
Module: Stencil
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| lib/pixmill/stencil/fleur-de-lis.rb | Ruby | Kenneth F. Guerin | Copyright © 2022, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/stencil/gear.rb | Ruby | Kenneth F. Guerin | Copyright © 2022, Kenneth F. Guerin, all rights reserved. |
| lib/pixmill/stencil/star.rb | Ruby | Kenneth F. Guerin | Copyright © 2022, Kenneth F. Guerin, all rights reserved. |
Overview
Method Registry
Method Details
build → String
This method will build a path descriptior snippet.Returns:
- [String] — the path descriptor snippet
The PixMill Graphics Toolkit
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| boundingBox.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| canvas.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| colorTable.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| colorTools.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| defctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| graphicsState.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| ncsctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pathDescriptor.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pattern.js | Javascript | Kenneth F. Guerin | Copyright © 2025, Brick Mill Games, LLC, all rights reserved. |
| pixmill.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| resenectab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| textAttributes.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| w3cctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Contents Directory
Namespace: PixMill
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| boundingBox.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| canvas.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| colorTable.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| colorTools.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| defctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| graphicsState.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| ncsctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pathDescriptor.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pattern.js | Javascript | Kenneth F. Guerin | Copyright © 2025, Brick Mill Games, LLC, all rights reserved. |
| pixmill.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
| resenectab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| textAttributes.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| w3cctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
The PixMill namespace encapsulates all definitions related to the family of PixMill classes.
The PixMill library is a library which handles graphics drawing and layouts to a canvas, which sits on top of a Javascript Canvas object.
Constant Registry
Function Registry
Constant Details
PixMill.CTAB_IGNORE → Integer <read-only>
This constant is used to specify that attempts to load duplicate entries into a color table will be ignored.PixMill.CTAB_OVERWRITE → Integer <read-only>
This constant is used to specify that attempts to load duplicate entries into a color table will be overwrite the existing specification.PixMill.CTAB_THROWS → Integer <read-only>
This constant is used to specify that attempts to load duplicate entries into a color table will cause an exception to be thrown.PixMill.DEFCTab → Object <read-only>
This object contains a very simple color table of names and color specifications.PixMill.GRAVITIES → Array<String> <read-only>
This constant contains an array of possible object gravity layout locations as strings.PixMill.LAYOUTS → Array<String> <read-only>
This constant contains an array of possible object layout types as strings.PixMill.NCSCTab → Object <read-only>
This object contains a color table of names and color specifications based on the Natural Color System standard.PixMill.ReseneCTab → Object <read-only>
This object contains a color table of names and color specifications based on colors provided by the Resene company.PixMill.STRETCHES → Array<String> <read-only>
This constant contains an array of possible font stretches as strings.PixMill.STYLES → Array<String> <read-only>
This constant contains an array of possible font styles as strings.PixMill.UNDERLINES → Array<String> <read-only>
This constant contains an array of possible font underlines as strings.PixMill.VARIANTS → Array<String> <read-only>
This constant contains an array of possible font variants as strings.PixMill.W3CCTab → Object <read-only>
This object contains a color table of names and color specifications based on the W3C specification.PixMill.WEIGHTS → Array<String> <read-only>
This constant contains an array of possible font weights as strings.Function Details
PixMill.colorToGrayRGBCspec(cspec) → String or Array<Number> or Null
This function converts an RGB specification to the nearest neutral tone color using the NTSC formula.Parameters:
- cspec [String or Array<Number>] — the RGB color specification
Returns:
- [String or Array<Number> or Null] — the neutral tone RGB specification, or null if the input is invalid or unrecognizable
PixMill.convertCMYKACspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid CMYKA color specification into another one of a specified type.Parameters:
- type [String] — the type of color specification to convert to: { 'atstring','integers','floats' }
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Array<Number> or Null] — the new CMYKA color specification, or Null if invalid
Throws:
- [ArgumentError] — if the color specification type is invalid or unrecognizable
PixMill.convertCMYKACspecToCMYKCspec(cspec) → String or Array<Number> or Null
This function converts a valid CMYKA color specification into an CMYK color specification by removing the trailing alpha value.Parameters:
- cspec [String or Array<Number>] — the CMYKA color specification
Returns:
- [String or Array<Number> or Null] — the new CMYK color specification, or Null if invalid
PixMill.convertCMYKCspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid CMYK color specification into another one of a specified type.Parameters:
- type [String] — the type of color specification to convert to: { 'hashstring','integers','floats' }
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Array<Number> or Null] — the new CMYK color specification, or Null if invalid
Throws:
- [ArgumentError] — if the color specification type is invalid or unrecognizable
PixMill.convertRGBACspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid RGBA color specification into another one of a specified type.Parameters:
- type [String] — the type of color specification to convert to: { 'atstring','integers','floats' }
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Array<Number> or Null] — the new RGBA color specification, or Null if invalid
Throws:
- [ArgumentError] — if the color specification type is invalid or unrecognizable
PixMill.convertRGBACspecToRGBCspec(cspec) → String or Array<Number> or Null
This function converts a valid RGBA color specification into an RGB color specification by removing the trailing alpha value.Parameters:
- cspec [String or Array<Number>] — the RGBA color specification
Returns:
- [String or Array<Number> or Null] — the new RGB color specification, or Null if invalid
PixMill.convertRGBCspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid RGB color specification into another one of a specified type.Parameters:
- type [String] — the type of color specification to convert to: { 'hashstring','integers','floats' }
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Array<Number> or Null] — the new RGB color specification, or Null if invalid
Throws:
- [ArgumentError] — if the color specification type is invalid or unrecognizable
PixMill.extractAlphaFromCMYKACspec(cspec) → String or Number or Null
This function extracts the alpha value from a valid CMYKA color specification. The format of the value depends on the format of the original color specification.Parameters:
- cspec [String or Array<Number>] — the CMYKA color specification
Returns:
- [String or Number or Null] — the Alpha color specification, or Null if invalid
PixMill.extractAlphaFromRGBACspec(cspec) → String or Number or Null
This function extracts the alpha value from a valid RGBA color specification. The format of the value depends on the format of the original color specification.Parameters:
- cspec [String or Array<Number>] — the RGBA color specification
Returns:
- [String or Number or Null] — the Alpha color specification, or Null if invalid
PixMill.isGrayRGBCspec(cspec) → Boolean
This function determines if a given RGB color specification is a neutral (gray) color (R=G=B).Parameters:
- cspec [String or Array<Number>] — the RGB color specification
Returns:
- [Boolean] — true, if the color is gray
PixMill.isValidCMYKACspec(cspec) → Boolean
This function determines if a given color specification is a valid CMYKA specification.Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [Boolean] — true, if the cspec is valid
PixMill.isValidCMYKCspec(cspec) → Boolean
This function determines if a given color specification is a valid CMYK specification.Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [Boolean] — true, if the cspec is valid
PixMill.isValidRGBACspec(cspec) → Boolean
This function determines if a given color specification is a valid RGBA specification.Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [Boolean] — true, if the cspec is valid
PixMill.isValidRGBCspec(cspec) → Boolean
This function determines if a given color specification is a valid RGB specification.Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [Boolean] — true, if the cspec is valid
PixMill.randomGrayRGBCspec(base, range, type) → String or Array<Number> ⇏ ArgumentError
This function creates a random neutral tone (gray) RGB color specification.Parameters:
- base [Number] — the minimum intensity value for any of the component values <default: 0>
- range [Number] — the minimum intensity value for any of the component values <default: 255>
- type [String] — the type of color specification to create: { 'hashstring','integers','floats' } <default: 'integers'>
Returns:
- [String or Array<Number>] — the random RGB specification
Throws:
- [ArgumentError] — if base < 0, range < 0, (base+range)>255
PixMill.randomRGBCspec(base, range, type) → String or Array<Number> ⇏ ArgumentError
This function creates a random RGB color specification.Parameters:
- base [Number] — the minimum intensity value for any of the component values <default: 0>
- range [Number] — the minimum intensity value for any of the component values <default: 255>
- type [String] — the type of color specification to create: { 'hashstring','integers','floats' } <default: 'integers'>
Returns:
- [String or Array<Number>] — the random RGB specification
Throws:
- [ArgumentError] — if base < 0, range < 0, (base+range)>255
PixMill.typeOfCMYKACspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'atstring','integers','floats' }Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Null] — the type of color specification
PixMill.typeOfCMYKCspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'hashstring','integers','floats' }Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Null] — the type of color specification
PixMill.typeOfRGBACspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'atstring','integers','floats' }Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Null] — the type of color specification
PixMill.typeOfRGBCspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'hashstring','integers','floats' }Parameters:
- cspec [String or Array<Number>] — the color specification
Returns:
- [String or Null] — the type of color specification
Class: PixMill.BoundingBox
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| boundingBox.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages all bounding box operations.
The BoundingBox class is used for graphics object layouts. In essence, it's a simple rectangle with some shortcut variables, such as x2,y2 and cx,cy.
Method Registry
Method Details
bottomleft() → Array<Number>
This method returns the bottom-left location of the bounding box as a 2-element array.Returns:
- [Array<Number>] — the bottom-left location of the bounding box
bottomright() → Array<Number>
This method returns the bottom-right location of the bounding box as a 2-element array.Returns:
- [Array<Number>] — the bottom-right location of the bounding box
center() → Array<Number>
This method returns the center location of the bounding box as a 2-element array.Returns:
- [Array<Number>] — the center location of the bounding box
move(dx, dy) → PixMill.BoundingBox
This method moves the bounding box to a new location some distance away.Parameters:
- dx [Number] — the offset along the x-axis to move
- dy [Number] — the offset along the y-axis to move
Returns:
- [PixMill.BoundingBox] — itself
moveTo(x, y) → PixMill.BoundingBox
This method moves the bounding box to a new location.Parameters:
- x [Number] — the x-coordinate of the top-left corner
- y [Number] — the y-coordinate of the top-left corner
Returns:
- [PixMill.BoundingBox] — itself
moved(dx, dy) → PixMill.BoundingBox
This method creates a new bounding box based on this one, but moved some distance awayParameters:
- dx [Number] — the offset along the x-axis to move
- dy [Number] — the offset along the y-axis to move
Returns:
- [PixMill.BoundingBox] — a new bounding box based on this box's size, but moved some distance away
position() → Array<Number>
This method returns the bounding box position as a 2-element array.Returns:
- [Array<Number>] — the position of the bounding box
rect() → Array<Number>
This method returns the location and size of the bounding box as a 4-element array.Returns:
- [Array<Number>] — the location and size of the bounding box
resize(dw, dh) → PixMill.BoundingBox ⇏ ArgumentError
This method resizes the bounding box according to specified deltas.Parameters:
- dw [Number] — the difference in width
- dh [Number] — the difference in height
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the new calculated width or height is <0
resizeTo(w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method resizes the bounding box.Parameters:
- w [Number] — the new width of the bounding box
- h [Number] — the new height of the bounding box
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the new calculated width or height is <0
resized(w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method creates a new bounding box at this box's location, but with a different size.Parameters:
- w [Number] — the new width
- h [Number] — the new height
Returns:
- [PixMill.BoundingBox] — the new bounding box
Throws:
- [ArgumentError] — if the new calculated width or height is <0
setFromBox(x, y, x2, y2) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its top-left and bottom-right box positions.Parameters:
- x [Number] — the x-coordinate of the top-left corner of the bounding box
- y [Number] — the y-coordinate of the top-left corner of the bounding box
- x2 [Number] — the x-coordinate of the bottom-right corner of the bounding box
- y2 [Number] — the y-coordinate of the bottom-right corner of the bounding box
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the calculated width or height is <0
setFromCxyr(cx, cy, r) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its center position and a radius from the center.Parameters:
- cx [Number] — the x-coordinate of the center of the bounding box
- cy [Number] — the y-coordinate of the center of the bounding box
- r [Number] — a radius from the center point
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the calculated width or height is <0
setFromCxywh(cx, cy, w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its center position and its size.Parameters:
- cx [Number] — the x-coordinate of the center of the bounding box
- cy [Number] — the y-coordinate of the center of the bounding box
- w [Number] — the width of the bounding box
- h [Number] — the height of the bounding box
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the width or height is <0
setFromCxyxryr(cx, cy, xr, yr) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its center position and x-axis and y-axis radii.Parameters:
- cx [Number] — the x-coordinate of the center of the bounding box
- cy [Number] — the y-coordinate of the center of the bounding box
- xr [Number] — an x-axis radius from the center point
- yr [Number] — an y-axis radius from the center point
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the calculated width or height is <0
setFromPts(pts) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box to a location and size which will contain all of the specified points in the array.Parameters:
- pts [Variadic] — the specified points
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the specified points are invalid or unrecognizable
setFromXywh(x, y, w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its top-left box position and its size.Parameters:
- x [Number] — the x-coordinate of the top-left corner of the bounding box
- y [Number] — the y-coordinate of the top-left corner of the bounding box
- w [Number] — the width of the bounding box
- h [Number] — the height of the bounding box
Returns:
- [PixMill.BoundingBox] — itself
Throws:
- [ArgumentError] — if the width or height is <0
size() → Array<Number>
This method returns the bounding box size as a 2-element array.Returns:
- [Array<Number>] — the size of the bounding box
toArray() → Array<Number>
This method returns an array representation of the bounding box.Returns:
- [Array<Number>] — The array representation of the bounding box
toString() → String
This method returns a string representation of the bounding box.Returns:
- [String] — The string representation of the bounding box
topleft() → Array<Number>
This method returns the top-left location of the bounding box as a 2-element array.Returns:
- [Array<Number>] — the top-left location of the bounding box
topright() → Array<Number>
This method returns the top-right location of the bounding box as a 2-element array.Returns:
- [Array<Number>] — the top-right location of the bounding box
xywh() → Array<Number>
This method returns the location and size of the bounding box as a 4-element array.Returns:
- [Array<Number>] — the location and size of the bounding box
Class: PixMill.Canvas
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| canvas.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages all canvas operations.
The Canvas class is used for defining and managing the drawing surface and its mapping to its back-end destination.
Constructor Registry
Property Registry
Method Registry
Constructor Details
new PixMill.Canvas(width, height, ctab, fill)
This contructor creates the canvas and its underlying JS canvas element based on the given width and height. Initial color settings can also be provided.Parameters:
- width [Number] — the width of the drawing surface in pixels
- height [Number] — the height of the drawing surface in pixels
- ctab [PixMill.ColorTable] — the initial color table to use with the canvas <default: null>
- fill [Color] — the initial color to fill the canvas <default: null>
Property Details
rootbox → PixMill.Rectangle <read-only>
This property defines the base-level drawing surface location and dimension of the canvas.Method Details
erase() → PixMill.Canvas
This method erases the canvas.Returns:
- [PixMill.Canvas] — itself
reset() → PixMill.Canvas
This method erases the canvas and resets the associated graphics state.Returns:
- [PixMill.Canvas] — itself
setid(id) → PixMill.Canvas
This method assigns a DOM id to the underlying JS canvas.Parameters:
- id [String] — the DOM ID
Returns:
- [PixMill.Canvas] — itself
Class: PixMill.Circle ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a circle marking object.
A PixMill.Circle is a circular marking object with full layout and drawing capabilities.
Properties
The circle marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 1-element array containing the circle's radius
Constructor Registry
Method Registry
Constructor Details
new PixMill.Circle(properties) ⇏ RuntimeError
This constructor constructs a circle marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the circle
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- r [Number] — the radius of the circle
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the circle <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, r, scale, gs) <overload>
This overload method sets the properties of the the Circle marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- r [Number] — the radius of the circle
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Class: PixMill.ColorTable
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| colorTable.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages all color table operations.
The ColorTable class is used to manage symbol-to-color specification look-ups.
Constructor Registry
Method Registry
Constructor Details
new PixMill.ColorTable(source) ⇏ ArgumentError
This constructor creates a new ColorTable from an optional input source.The Input Source
The constructor's input source can either be a PixMill.ColorTable or a JS Object containing string/color-specification pairs. A null input source will create an empty color table.Parameters:
- source [Object or PixMill.ColorTable or Null] — the input source <default: null>
Throws:
- [ArgumentError] — if the incoming source is invalid or unrecognized
Method Details
delete(key) → PixMill.ColorTable
This method deletes an entry from the color table.Parameters:
- key [String] — the color specification key
Returns:
- [PixMill.ColorTable] — itself
get(key, type) → String or Array<Number> ⇏ RuntimeError
This method is used to retrieve a color specification from the color table. It can also reformat the color specification.Parameters:
- key [String] — the color specification key
- type [String or Null] — the type of color specification to return <default: null>
Returns:
- [String or Array<Number>] — the color specification
Throws:
- [RuntimeError] — if the key has not been defined or the type is not compatible with the color specification
getAllHtmlValues() → Hash
This method retruns a table consisting of the loaded color names and HTML specs.Returns:
- [Hash] — a table consisting of the loaded color names and HTML specs.
getClosestCspecKey(target) → String or Null
This method finds an entry in the color table which is closest to the specific color specification.Parameters:
- target [String or Array<Number>] — the target color specification
Returns:
- [String or Null] — the key of the color specification closest to the given target, or Null if the color table is empty
getCspecDifference(key, target) → Integer ⇏ ArgumentError
This method calculates the difference between a given named color and the given cspec.Parameters:
- key [String] — the color specification key
- target [String or Array<Number>] — the color specification key
Returns:
- [Integer] — the difference between the colors
Throws:
- [ArgumentError] — if the incoming source is invalid or unrecognized
getHtmlSpec(key) → String or Null
This method is used to retrieve the HTML color specification from the color table.Parameters:
- key [String] — the color specification key
Returns:
- [String or Null] — the HTML color specification, or Null if not found
hasKey(key) → Boolean
This method determines if the color table has a specified key defined.Parameters:
- key [String] — the color table key
Returns:
- [Boolean] — true, if the key has been defined
keys() → Array<String>
This method retrieves all of the color table keys.Returns:
- [Array<String>] — the list of color table keys
load(source, on_duplicate_entry) → PixMill.ColorTable ⇏ ArgumentError
This method is used to load this color table from an input source.Parameters:
- source [Object or PixMill.ColorTable] — the input source
- on_duplicate_entry [Integer] — the action to take if a duplicate entry is encountered <default: PixMill.CTAB_OVERWRITE>
Returns:
- [PixMill.ColorTable] — itself
Throws:
- [ArgumentError] — if on_duplicate_entry = PixMill.CTAB_THROWS and a duplicate entry is encountered
set(key, cspec, on_duplicate_entry) → PixMill.ColorTable ⇏ ArgumentError ⇏ RuntimeError
This method is used to set a color specification to a key. It will also create an HTML-compatible version.Parameters:
- key [String] — the color specification key
- cspec [String or Array<Number>] — the color specification key
- on_duplicate_entry [Integer] — the action to take if a duplicate entry is encountered <default: PixMill.CTAB_OVERWRITE>
Returns:
- [PixMill.ColorTable] — itself
Throws:
- [ArgumentError] — if the color specification is invalid or unrecognized
- [RuntimeError] — if on_duplicate_entry = PixMill.CTAB_THROWS and a duplicate entry is encountered
Class: PixMill.Ellipse ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines an ellipse marking object.
A PixMill.Ellipse is an elliptical marking object with full layout and drawing capabilities.
Properties
The ellipse marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 2-element array containing the ellipse's x-axis radius and y-axis radius
Constructor Registry
Method Registry
Constructor Details
new PixMill.Ellipse(properties) ⇏ RuntimeError
This constructor constructs a ellipse marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the ellipse
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- xr [Number] — the x-axis radius of the ellipse
- yr [Number] — the y-axis radius of the ellipse
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the ellipse <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, xr, yr, scale, gs) <overload>
This overload method sets the properties of the the Ellipse marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- xr [Number] — the x-axis radius of the ellipse
- yr [Number] — the y-axis radius of the ellipse
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Class: PixMill.GradientPattern
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pattern.js | Javascript | Kenneth F. Guerin | Copyright © 2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages all solid pattern construction and management.
The GradientPattern class is used for defining and managing the drawing surface and characteristics of gradient patterns.
Constructor Registry
Constructor Details
new PixMill.GradientPattern(type, props)
This contructor creates the solid pattern's underlying canvas based on the given fill color and color tableParameters:
- type [String] — the type of gradient pattern
- props [Hash] — the properties of the gradient pattern
Class: PixMill.Graphic ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a graphic marking object.
A PixMill.Graphic is an image marking object with full layout and drawing capabilities. The layout capability is tied to the text area's bounding box.
Note: This class used to be called Image, but an Image class definition already exists in the Javascript DOM.
Properties
The graphic marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 1-element array containing the image's surface
Constructor Registry
Method Registry
Constructor Details
new PixMill.Graphic(properties) ⇏ RuntimeError
This constructor constructs a graphic marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the graphic
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- surface [CanvasRenderingContext2D] — the surface containing the graphic/image data
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
draw(gs) → PixMill.MarkingObject ⇏ RuntimeError <overload>
This method defines the default marking object drawing.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object drawing
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the layout is not set
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, surface, scale, gs) <overload>
This overload method sets the properties of the the Graphic marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- surface [CanvasRenderingContext2D] — the surface containing the graphic/image data
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) ⇏ RuntimeError <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Throws:
- [RuntimeError] — always, graphic object cannot be traced
Class: PixMill.GraphicsState
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| graphicsState.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class is used to manage the graphics state for PixMill marking operations.
Constructor Registry
Method Registry
Constructor Details
new PixMill.GraphicsState(args) ⇏ ArgumentError
This constructor will create a graphics state attached to a given drawing context, with an optional color table, or will build a clone of another graphics state.Parameters:
- args [Variadic] — a PixMill.GraphicsState to clone or a CanvasRenderingContext2D, PixMill.ColorTable pairing
Throws:
- [ArgumentError] — if the constructor's arguments are invalid or unrecognizable
Method Details
$bezierMinMax() → Object <private>
This private method calculates the min & max points for bezier curve extent tracking.Returns:
- [Object] — the min and max extent information
$collectPathExtents(x, y, x2, y2) → PixMill.GraphicsState <private>
This private method manages the extents of the current path by collecting sole and/or min and max points.Parameters:
- x [Number] — the x-coordinate of the sole or first point
- y [Number] — the y-coordinate of the sole or first
- x2 [Number] — the x-coordinate of the second point <default: null>
- y2 [Number] — the y-coordinate of the second point <default: null>
Returns:
- [PixMill.GraphicsState] — this graphics state
$configSource(index, value) → PixMill.GraphicsState <private>
This private method sets the specified source to a value in a format compatible to the platform's drawing context.To Do: This implementation is partial, missing support for patterns and shaders (incl. gradient fills)
Parameters:
- index [String] — the source type to configure
- value [String or Array<Number>] — the incoming color specification or other source type
Returns:
- [PixMill.GraphicsState] — this graphics state
$extractHtml5Cspec(value) → String <private>
This private method retrieves and/or converts a color specification to an HTML5-formatted one.Parameters:
- value [String or Array<Number>] — the color specification or color table key
Returns:
- [String] — an HTML5-formatted color specification
$fillProc(path) → PixMill.GraphicsState <private>
This private method sets the fill parameters and does a fill operation on the attached drawing context.Parameters:
- path [Path2D] — the path that describes the object to fill
Returns:
- [PixMill.GraphicsState] — this graphics state
$genCanvasBBox(w, h, ctm) → Array<Number> <private>
This private method generates a 4-element bounding box of the canvas' drawing surface. The current CTM is taken into account when calculating the bounding box, so the canvas may be offset, rotated and/or scaled.Parameters:
- w [Number] — the width of the attached canvas
- h [Number] — the height of the attached canvas
- ctm [Array<Number>] — the CTM array used for calculations
Returns:
- [Array<Number>] — the 4-element array of x, y, width, height of the bounding box enclosing the canvas' drawing surface
$getHeight() → Number <private>
This private method returns the height of the attached canvas.Returns:
- [Number] — the height of the canvas
$getWidth() → Number <private>
This private method returns the width of the attached canvas.Returns:
- [Number] — the width of the canvas
$quadraticMinMax() → Object <private>
This private method calculates the min & max points for quadratic bezier curve extent tracking.Returns:
- [Object] — the min and max extent information
$strokeProc(path, width, loc) → PixMill.GraphicsState <private>
This private method sets the stroke parameters and does a stroke operation on the attached drawing context.Parameters:
- path [Path2D] — the path that describes the object to fill
- width [Number] — the stroke width in pixels
- loc [Boolean] — true, if the stroke should be clipped to the inside of the object
Returns:
- [PixMill.GraphicsState] — this graphics state
arc(x, y, radius, startAngle, endAngle, anticlockwise) → PixMill.GraphicsState
This method adds an arc sub-path to the current path.Parameters:
- x [Number] — the x-coordinate of the center point of the circle which defines the arc
- y [Number] — the y-coordinate of the center point of the circle which defines the arc
- radius [Number] — the radius of the circle which defines the arc
- startAngle [Number] — the angle defining the location of the start point of the arc, in radians
- endAngle [Number] — the angle defining the location of the end point of the arc, in radians
- anticlockwise [Boolean] — true, if the arc is to be drawn anti-/counter-clockwise <default: false>
Returns:
- [PixMill.GraphicsState] — this graphics state
arcTo() → PixMill.GraphicsState
This method will draw an arc from theTo Do: This method is incomplete with regard to extent tracking.
Returns:
- [PixMill.GraphicsState] — this graphics state
beginPath() → PixMill.GraphicsState
This method creates a new path.Returns:
- [PixMill.GraphicsState] — this graphics state
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) → PixMill.GraphicsState
This method traces a cubic bezier curve from the current point to a specified point using two control points.Parameters:
- cp1x [Number] — the x-coordinate of the first control point
- cp1y [Number] — the y-coordinate of the first control point
- cp2x [Number] — the x-coordinate of the second control point
- cp2y [Number] — the y-coordinate of the second control point
- x [Number] — the x-coordinate of the end point
- y [Number] — the y-coordinate of the end point
Returns:
- [PixMill.GraphicsState] — this graphics state
clipto(preserve) → PixMill.GraphicsState
This method defines a clip region defined by the current path.Parameters:
- preserve [Boolean] — true, if the current path is to be preserved <default: false>
Returns:
- [PixMill.GraphicsState] — this graphics state
clone(incl_stack) → PixMill.GraphicsState
This method clones the current graphics state.Parameters:
- incl_stack [Boolean] — true, if the clone includes the graphics state stack <default: false>
Returns:
- [PixMill.GraphicsState] — this graphics state cloned
closePath() → PixMill.GraphicsState
This method closes the existing path.Returns:
- [PixMill.GraphicsState] — this graphics state
copyPath() → Path2D
This method returns a copy of the current path.Returns:
- [Path2D] — the copy of the current path
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) → PixMill.GraphicsState
This method adds an elliptical arc sub-path to the current path.Parameters:
- x [Number] — the x-coordinate of the center point of the circle which defines the arc
- y [Number] — the y-coordinate of the center point of the circle which defines the arc
- radiusX [Number] — the x-axis radius of the ellipse which defines the arc
- radiusY [Number] — the y-axis radius of the ellipse which defines the arc
- rotation [Number] — the tilt of the ellipse, in radians
- startAngle [Number] — the angle defining the location of the start point of the arc, in radians
- endAngle [Number] — the angle defining the location of the end point of the arc, in radians
- anticlockwise [Boolean] — true, if the arc is to be drawn anti-/counter-clockwise <default: false>
Returns:
- [PixMill.GraphicsState] — this graphics state
getPathExtents() → Array<Number>
This method returns the extents of the current path.Returns:
- [Array<Number>] — the 4-element extent array
lineTo(x, y) → PixMill.GraphicsState
This method traces a line from the current point to the given point in the current path.Parameters:
- x [Number] — the x-coordinate of the point
- y [Number] — the y-coordinate of the point
Returns:
- [PixMill.GraphicsState] — this graphics state
moveTo(x, y) → PixMill.GraphicsState
This method sets the current point in the current path.Parameters:
- x [Number] — the x-coordinate of the point
- y [Number] — the y-coordinate of the point
Returns:
- [PixMill.GraphicsState] — this graphics state
paint() → PixMill.GraphicsState
This method paints the entire canvas with the current fill source.Returns:
- [PixMill.GraphicsState] — this graphics state
pathToSvgPath()
This method converts the current path to an SVG format path description.pop(n) → PixMill.GraphicsState
This method pops one or more graphics states from the graphics state stack.Parameters:
- n [Integer] — the number of graphics states to pop off the stack <default: 1>
Returns:
- [PixMill.GraphicsState] — this graphics state
popAll() → PixMill.GraphicsState
This method pops the entire GS stack.Returns:
- [PixMill.GraphicsState] — this graphics state
push(proc) → PixMill.GraphicsState
This method pushes a new graphics state onto the graphics state stack. The new graphics state is a clone of the current graphics state. If an optional procedure is supplied, the graphics state will be popped after the procedure is run.Parameters:
- proc [Function] — the proc to call after the new graphics state is pushed <default: null>
Returns:
- [PixMill.GraphicsState] — this graphics state
quadraticCurveTo(cpx, cpy, x, y) → PixMill.GraphicsState
This method traces a quadratic bezier curve from the current point to a specified point using a control point.Parameters:
- cpx [Number] — the x-coordinate of the control point
- cpy [Number] — the y-coordinate of the control point
- x [Number] — the x-coordinate of the end point
- y [Number] — the y-coordinate of the end point
Returns:
- [PixMill.GraphicsState] — this graphics state
rect(x, y, w, h) → PixMill.GraphicsState
This method adds a rectangular sub-path to the current path.Parameters:
- x [Number] — the x-coordinate of the top-left position of the rectangle
- y [Number] — the y-coordinate of the top-left position of the rectangle
- w [Number] — the width of the rectangle
- h [Number] — the height of the rectangle
Returns:
- [PixMill.GraphicsState] — this graphics state
reset() → PixMill.GraphicsState
This method resets a graphics state to its initial state.Returns:
- [PixMill.GraphicsState] — this graphics state
restorePath() → PixMill.GraphicsState
This method restores the current saved path and state.Returns:
- [PixMill.GraphicsState] — this graphics state
rrect(x, y, w, h, xr, yr) → PixMill.GraphicsState
This method adds a rounded rectangular sub-path to the current path.Parameters:
- x [Number] — the x-coordinate of the top-left position of the rectangle
- y [Number] — the y-coordinate of the top-left position of the rectangle
- w [Number] — the width of the rectangle
- h [Number] — the height of the rectangle
- xr [Number] — the x-axis radius of the corners of the rectangle
- yr [Number] — the y-axis radius of the corners of the rectangle
Returns:
- [PixMill.GraphicsState] — this graphics state
savePath() → PixMill.GraphicsState
This method saves the current path and state. There is no stack.Returns:
- [PixMill.GraphicsState] — this graphics state
set(options) → PixMill.GraphicsState
This method sets graphics state settings and properties.Parameters:
- options [Object] — an object of key/value pairs containing the graphics state settings to set
Returns:
- [PixMill.GraphicsState] — this graphics state
strokeFill(preserve) → PixMill.GraphicsState
This method does a combined fill and/or stroke operation along the current path.Parameters:
- preserve [Boolean] — will reset the path if false <default: false>
Returns:
- [PixMill.GraphicsState] — this graphics state
unclip() → PixMill.GraphicsState
This method removes the topmost clip region from the clip stack.Returns:
- [PixMill.GraphicsState] — this graphics state
Class: PixMill.Hexagon ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a hexagon marking object.
A PixMill.Hexagon is a hexagonal marking object with full layout and drawing capabilities.
Properties
The hexagon marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 2-element array containing the hexagon's edge-to-edge size and orientation
Constructor Registry
Method Registry
Constructor Details
new PixMill.Hexagon(properties) ⇏ RuntimeError
This constructor constructs a hexagon marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the hexagon
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- size [Number] — the edge-to-edge size of the hexagon
- orientation [String] — the orientation of the hexagon <default: 'wide'>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the hexagon <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, size, orientation, scale, gs) <overload>
This overload method sets the properties of the the Hexagon marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- size [Number] — the edge-to-edge size of the hexagon
- orientation [String] — the orientation of the hexagon <default: 'wide'>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Class: PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class contains common code and defines a common API for all PixMill marking objects.
This PixMill.MarkingObject is a combination layout and drawing object manager. All marking objects can be drawn and can also be used as a layout parent, via its bbox (or bounding box).
Place, Trace, Draw
The place, trace and draw API is used to manage the placement of the object, to trace its shape (thereby defining its bbox) and draw it. The API is designed such that each derived object can override the default functionality as defined within the base MarkingObject class.A fourth, quiet, member of the API is cliptrace, a function used to trace the object for clip region management purposes.
Constructor Registry
Method Registry
Constructor Details
new PixMill.MarkingObject()
The constructor is a no-op. The derived classes provide the functionality.Method Details
$calcDim(scale, value) → Number <private> <deprecate>
This private method calculates a dimension value of the object based on the specified scale.Parameters:
- scale [Number] — the scale factor
- value [Number] — the value to adjust
Returns:
- [Number] — the scaled value
$parentIsBase() → Boolean <private>
Returns:
- [Boolean] — true if the parent is a drawing surface
$parentIsViewport() → Boolean <private>
Returns:
- [Boolean] — true if the parent is a PixMill.Viewport
bbox() → PixMill.BoundingBox
This method returns the marking object's bbox (bounding box).Note: Some layouts may be arrays, in which case the first array is the primary bounding box.
Returns:
- [PixMill.BoundingBox] — the marking object's bounding box
clipto(gs) → PixMill.MarkingObject
This method sets the underlying graphics state's clip region to the marking object's shape.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to set the clip region
Returns:
- [PixMill.MarkingObject] — this marking object
cliptrace(gs, force_placement) → PixMill.MarkingObject ⇏ RuntimeError
This method defines the default marking object shape tracing logic for clip region creation, aka path creation. For clip region creation, some derived objects may use its bbox as its clip region shape.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if there the marking object does not have a valid layout
draw(gs, eproc) → PixMill.MarkingObject ⇏ RuntimeError
This method defines the default marking object drawing.Note: Most of the time, the derived object don't need to override this behavior. Most of the time...
Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object drawing
- eproc [Function] — a function to call if the trace API call has thrown an exception <default: null>
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the trace call threw an uncaught exception
place(gs) → PixMill.MarkingObject
This method is used to set the object's layout for tracing and drawing purposes. As the base class is essentially a null object, there is no layout.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(type, parent) → PixMill.MarkingObject
This method sets the common properties of all marking objects. Each derived class will define the types of each property and interact with them.Parameters:
- type [String] — the name of the type of the derived marking object
- parent [PixMill.MarkingObject or PixMill.GraphicsState] — the
Returns:
- [PixMill.MarkingObject] — this marking object
setHexagonLayout(gs, ee, orientation) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a hexagonal marking object onto a drawing context using graphics state parameters.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used to place the object
- ee [Number] — the edge-to-edge size of the hexagon
- orientation [String] — the orientation of the hexagon as a string: { 'wide', 'tall' } <default: 'wide'>
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the marking object is a PixMill.Viewport and x,y positioning or scaling is specified
setImageLayout(gs, surface) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place an image marking object onto a drawing context using graphics state parameters.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used to place the object
- surface [Image] — the image surface to be placed
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the marking object is a PixMill.Viewport and x,y positioning or scaling is specified
setPolyLayout(gs, minmax) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a polygon marking object onto a drawing context using graphics state parameters.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used to place the object
- minmax [Array<Number>] — a 4-element array of xy-minmax values that define the bounds of the effective area of the polygon
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the marking object is a PixMill.Viewport and x,y positioning or scaling is specified
setRadiiLayout(gs, xr, yr) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a circular/elliptical marking object onto a drawing context using graphics state parameters.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used to place the object
- xr [Number] — the radius of a circular object or the x-axis radius of an elliptical object
- yr [Number] — the y-axis radius of an elliptical object, should be equal to xr for a circular object <default: xr>
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the marking object is a PixMill.Viewport and x,y positioning or scaling is specified
setTextLayout(gs, width, height) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a text marking object onto a drawing context using graphics state parameters. The width and height parameters are non-rotated parameters. If the graphics state specifies any rotation or scaling, the appropriate values will be calculated.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used to place the object
- width [Number] — the width of the string
- height [Number] — the heighth of the string
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the marking object is a PixMill.Viewport and x,y positioning or scaling is specified
setWhLayout(gs, w, h) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a rectangular marking object onto a drawing context using graphics state parameters.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used to place the object
- w [Number] — the width of the rectangular object
- h [Number] — the height of the rectangular object
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the marking object is a PixMill.Viewport and x,y positioning or scaling is specified
trace(gs, force_placement) → PixMill.MarkingObject ⇏ RuntimeError
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Note: Due to how Javascript class inheritance works, while this method is defined within PixMill.MarkingObject, 'this' may be referring to a derived (real) object, so this.place() will call the correct method.
Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if there the marking object does not have a valid layout
unclip(gs) → PixMill.MarkingObject
This method resets the underlying graphics state's clip region.Parameters:
- gs [PixMill.GraphicsState] — the graphics state
Returns:
- [PixMill.MarkingObject] — this marking object
update(props) → PixMill.MarkingObject
This method updates the property values for the marking object.Parameters:
- props [Array] — The properties to assign to the marking object
Returns:
- [PixMill.MarkingObject] — this marking object
viewport() → PixMill.Viewport
This method returns the marking object's viewport.Returns:
- [PixMill.Viewport] — the marking object's viewport, or itself
Class: PixMill.Path ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a path marking object.
A PixMill.Path is a path marking object with full layout and drawing capabilities.
Properties
The path marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 3-element array containing:
- the path's string description
- the path's PathDescriptor
- a 2-element array of path extents (set during place())
Constructor Registry
Method Registry
Constructor Details
new PixMill.Path(properties) ⇏ RuntimeError
This constructor constructs a path marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the path
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- desc [String] — the path description
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the path <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, desc, scale, gs) <overload>
This overload method sets the properties of the the Path marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- desc [String] — the path description
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Class: PixMill.PathDescriptor
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pathDescriptor.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class tokenizes an SVG-style path description.
Constructor Registry
Method Registry
Constructor Details
new PixMill.PathDescriptor(desc)
This constructor tokenizes the given path description for analysis or rendering.Parameters:
- desc [String] — the path description
Method Details
$compile() → Boolean <private>
This private method tokenizes the path descriptor string.Returns:
- [Boolean] — true, if successful
anyTokens() → Boolean
This method determines if any tokens have been defined.Returns:
- [Boolean] — true, if there are tokens
set(desc) → Boolean
This method tokenizes the given patah description.Parameters:
- desc [String] — the path description
Returns:
- [Boolean] — true, if any tokens have been parsed successfully
trace(gs, absx, absy, relx, rely)
This method draws the tokenized information using the given graphics state.Parameters:
- gs [PixMill.GraphicsState] — the graphics state
- absx [Function] — the function to call to compute an absolute x-coordinate value <default: (x) => { return x }>
- absy [Function] — the function to call to compute an absolute y-coordinate value <default: (y) => { return y }>
- relx [Function] — the function to call to compute a relative x-coordinate value <default: (rx) => { return rx }>
- rely [Function] — the function to call to compute a relative y-coordinate value <default: (ry) => { return ry }>
Class: PixMill.Pattern
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pattern.js | Javascript | Kenneth F. Guerin | Copyright © 2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages all pattern operations.
The Pattern class is used for defining and managing all PixMill pattern types.
Constructor Registry
Method Registry
Constructor Details
new PixMill.Pattern(options)
This contructor creates a pattern based on the input parameters.Parameters:
- options [Hash] — the pattern initialization data
Method Details
$getPathAnchorInfo(gs) → Array<Number> <private>
This private method gets the pattern offsets required for anchored positioning.Parameters:
- gs [PixMill.GraphicsState] — the graphics state containing the current path extents
Returns:
- [Array<Number>] — the coordinate to anchor the pattern to as its origin
Class: PixMill.Polygon ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a polygon marking object.
A PixMill.Polygon is a polygonal marking object with full layout and drawing capabilities.
Properties
The polygon marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 4-element array containing:
- the polygon's open or closed state
- the size of the point array defining the polygon
- the array of points defining the polygon
- an array of translated points defining the polygon after placement (set during place())
Constructor Registry
Method Registry
Constructor Details
new PixMill.Polygon(properties) ⇏ RuntimeError
This constructor constructs a polygon marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the polygon
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- points [Array<Number>] — the points of the polygon as a single-dimension Array of coordinates
- closed [Boolean] — true, if the polygon path is closed <default: true>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the polygon <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, points, closed, scale, gs) <overload>
This overload method sets the properties of the the Polygon marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- points [Array<Number>] — the points of the polygon as a single-dimension Array of coordinates
- closed [Boolean] — true, if the polygon path is closed <default: true>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Class: PixMill.Rectangle ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a rectangle marking object.
A PixMill.Rectangle is a rectangular marking object with full layout and drawing capabilities. This marking object also supports rounded rectangles as well.
Properties
The rectangle marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 4-element array containing the rectangle parameters: width, height, x-axis corner radius, y-axis corner radius
Constructor Registry
Method Registry
Constructor Details
new PixMill.Rectangle(properties) ⇏ RuntimeError
This constructor constructs a rectangle marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the rectangle
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- w [Number] — the width of the rectangle
- h [Number] — the height of the rectangle
- xr [Number] — the x-axis radius of the corners of a rounded rectangle, if specified <default: null>
- yr [Number] — the y-axis radius of the corners of a rounded rectangle, if specified <default: null>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the rectangle <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, w, h, xr, yr, scale, gs) <overload>
This overload method sets the properties of the the Rectangle marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- w [Number] — the width of the rectangle
- h [Number] — the height of the rectangle
- xr [Number] — the x-axis radius of the corners of a rounded rectangle, if specified <default: null>
- yr [Number] — the y-axis radius of the corners of a rounded rectangle, if specified <default: null>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Returns:
- [PixMill.MarkingObject] — this marking object
Class: PixMill.SolidPattern
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pattern.js | Javascript | Kenneth F. Guerin | Copyright © 2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages all solid pattern construction and management.
The SolidPattern class is used for defining and managing the drawing surface and characteristics of solid color patterns.
Constructor Registry
Constructor Details
new PixMill.SolidPattern(cspec)
This contructor creates the solid pattern's underlying canvas based on the given fill color and color tableParameters:
- cspec [Color] — the initial color to fill the pattern
Class: PixMill.SurfacePattern
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pattern.js | Javascript | Kenneth F. Guerin | Copyright © 2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages all surface pattern construction and management.
The SurfacePattern class is used for defining and managing the drawing surface and characteristics of surface patterns. Surface patterns are drawable and their boundaries are set via the given starting graphic and/or width,height parameters.
Constructor Registry
Constructor Details
new PixMill.SurfacePattern(surface, width, height, ctab, fill)
This contructor creates the surface pattern's underlying canvas based on the given parametersParameters:
- surface [PixMill.Canvas or HTMLImageElement or HTMLCanvasElement or Function] — the initial graphic to copy into, if a function it will build the graphic dynamically
- width [Integer] — the width of the pattern, or the width of the initial graphic if 0 <default: 0>
- height [Integer] — the height of the pattern, or the width of the initial graphic if 0 <default: 0>
- ctab [PixMill.ColorTable] — the initial color table to use with the pattern <default: null>
- fill [Color] — the initial color to fill the canvas <default: null>
Class: PixMill.Text ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a text marking object.
A PixMill.Text is a text marking object with full layout and drawing capabilities. The layout capability is tied to the text area's bounding box.
Properties
The text marking object's property list is a 2-element array:- the scale factor, with 0 meaning unscaled
- a 7-element array containing:
- the character string of the text object
- the scale factor applied to the font
- a boolean denoting whether the text object will "snap to ink"
- an optional text attribute list to apply to the string
- the font specification used after the font scaling was applied (set during place())
- the font properties applied after possible autofitting (set during place())
- text drawing parameters (set during place())
Constructor Registry
Method Registry
Constructor Details
new PixMill.Text(properties) ⇏ RuntimeError
This constructor constructs a text marking object from the supplied parameters.Parameters:
- properties [Object] — the properties of the text
- parent [PixMill.MarkingObject] — the parent object which defines the placement reference point
- string [String] — the text string
- fontscale [Integer] — the scale factor for the font <default: 0>
- snap_to_ink [Boolean] — true, if the bounding box of the marking object will be reduced to the area inked <default: false>
- attribute_list [PixMill.TextAttributes] — attributes to apply to the text string <default: null>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the text <default: null>
Throws:
- [RuntimeError] — if the properties parameter is missing required elements
Method Details
cliptrace(gs) <overload>
This method defines the default marking object shape tracing logic for clip region creation, aka path creation.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to set the clip region
draw(gs) → PixMill.MarkingObject ⇏ RuntimeError <overload>
This method defines the default marking object drawing.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object drawing
Returns:
- [PixMill.MarkingObject] — this marking object
Throws:
- [RuntimeError] — if the layout is not set
place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.Parameters:
- gs [PixMill.GraphicsState] — the graphics state used for object placement
Returns:
- [PixMill.MarkingObject] — this marking object
set(parent, string, fontscale, snap_to_ink, attribute_list, scale, gs) <overload>
This overload method sets the properties of the the Text marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- string [String] — the text string
- fontscale [Integer] — the scale factor for the font <default: 0>
- snap_to_ink [Boolean] — true, if the bounding box of the marking object will be reduced to the area inked <default: false>
- attribute_list [PixMill.TextAttributes] — attributes to apply to the text string <default: null>
- scale [Integer] — the scale factor that defines the coordinate system coverage of the parent <default: 0>
- gs [PixMill.GraphicsState] — the graphics state associated with the graphic <default: null>
trace(gs, force_placement) ⇏ RuntimeError <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Parameters:
- gs [PixMill.GraphicsState] — the graphics state to use for object shape tracing
- force_placement [Boolean] — true, if the caller wants to force/overwrite a new placement layout <default: false>
Throws:
- [RuntimeError] — always, text object cannot be traced
Class: PixMill.TextAttributes
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| textAttributes.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
Overview
This class manages layout and drawing attributes for runs of characters within a text string.
Constructor Registry
Property Registry
Method Registry
Constructor Details
new PixMill.TextAttributes(attrs)
This constructor creates a PixMill.TextAttributes object w/o any attributes defined.Parameters:
- attrs [PixMill.TextAttributes] — a set of text attributes to clone <default: null>
Property Details
anyDrawingAttributes → Boolean <read-only>
This property returns true if any drawing attributes have been definedanyLayoutAttributes → Boolean <read-only>
This property returns true if any layout attributes have been definedanyUnderlineAttributes → Boolean <read-only>
This property returns true if any underline attributes have been definedlength → Integer <read-only>
This property returns the number of attributes definedMethod Details
$addToDrawingAttributes(name, value, si, ei) → PixMill.TextAttributes <private>
Parameters:
- name [String] — The name of the attribute
- value [Any] — The value of the attribute
- si [Integer] — the starting index of the range to cover
- ei [Integer] — the ending index of the range to cover
Returns:
- [PixMill.TextAttributes] — itself
$addToLayoutAttributes(name, value, si, ei) → PixMill.TextAttributes <private>
Parameters:
- name [String] — The name of the attribute
- value [Any] — The value of the attribute
- si [Integer] — the starting index of the range to cover
- ei [Integer] — the ending index of the range to cover
Returns:
- [PixMill.TextAttributes] — itself
addBackground(value, si, ei) → PixMill.TextAttributes
This method adds a background color attribute, which can optionally only apply to a range of the text.Parameters:
- value [Color] — The background color to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addFill(value, si, ei) → PixMill.TextAttributes
This method adds a fill attribute, which can optionally only apply to a range of the text.Parameters:
- value [Color] — The fill color to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addFontRelSize(value, si, ei) → PixMill.TextAttributes
This method adds a font relative size attribute, which can optionally only apply to a range of the text.Parameters:
- value [Number] — The relative size of the font
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addFontStyle(value, si, ei) → PixMill.TextAttributes
This method adds a font style attribute, which can optionally only apply to a range of the text.Parameters:
- value [PixMill.STYLES] — The font style to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addFontVariant(value, si, ei) → PixMill.TextAttributes
This method adds a font variant attribute, which can optionally only apply to a range of the text.Parameters:
- value [PixMill.VARIANTS] — The font variant to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addRise(value, si, ei) → PixMill.TextAttributes
This method adds a font rise attribute, which can optionally only apply to a range of the text.Parameters:
- value [Number] — The distance to rise the font glyphs
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addStretch(value, si, ei) → PixMill.TextAttributes
This method adds a font stretch attribute, which can optionally only apply to a range of the text.Parameters:
- value [PixMill.STRETCHES] — The font stretch to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addStrikethrough(value, si, ei) → PixMill.TextAttributes
This method adds a font strikethrough, which can optionally only apply to a range of the text.Parameters:
- value [Null] — Unused
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addStrikethroughColor(value, si, ei) → PixMill.TextAttributes
This method adds a strikethrough color attribute, which can optionally only apply to a range of the text.Parameters:
- value [Color] — The strikethrough color to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addStroke(value, si, ei) → PixMill.TextAttributes
This method adds a stroke attribute, which can optionally only apply to a range of the text.Parameters:
- value [Color] — The stroke color to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addStrokeWidth(value, si, ei) → PixMill.TextAttributes
This method adds a stroke width attribute, which can optionally only apply to a range of the text.Parameters:
- value [Number] — The stroke width to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addSubscript(value, si, ei) → PixMill.TextAttributes
This method adds a font subscript attribute, which can optionally only apply to a range of the text.Parameters:
- value [Null] — Unused
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addSuperscript(value, si, ei) → PixMill.TextAttributes
This method adds a font superscript attribute, which can optionally only apply to a range of the text.Parameters:
- value [Null] — Unused
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addUnderline(value, si, ei) → PixMill.TextAttributes
This method adds a font underline, which can optionally only apply to a range of the text.Parameters:
- value [PixMill.UNDERLINES] — The font underline to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addUnderlineColor(value, si, ei) → PixMill.TextAttributes
This method adds a underline color attribute, which can optionally only apply to a range of the text.Parameters:
- value [Color] — The underline color to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
addWeight(value, si, ei) → PixMill.TextAttributes
This method adds a font weight attribute, which can optionally only apply to a range of the text.Parameters:
- value [PixMill.WEIGHTS] — The font weight to use
- si [Integer] — the starting index of the range to cover <default: null>
- ei [Integer] — the ending index of the range to cover <default: null>
Returns:
- [PixMill.TextAttributes] — itself
collectDrawingAttributes(si, ei) → Object
This method collects the set of drawing attributes that apply to a given range.Parameters:
- si [Integer] — the starting index of the range <default: null>
- ei [Integer] — the ending index of the range <default: null>
Returns:
- [Object] — the collection of drawing attributes
eachBackgroundLayoutAttribute(callback)
This method calls a callback function for each background drawing attribute.Parameters:
- callback [Function] — the function to call for each background attribute
eachDrawingAttribute(callback)
This method calls a callback function for each defined drawing attribute.Parameters:
- callback [Function] — the function to call for each drawing attribute
eachLayoutAttribute(callback)
This method calls a callback function for each defined layout attribute.Parameters:
- callback [Function] — the function to call for each layout attribute
eachSpecificDrawingAttribute(attribute, callback)
This method calls a callback function for each specific drawing attribute.Parameters:
- attribute [String] — the specific attribute
- callback [Function] — the function to call for each drawing attribute
eachSpecificLayoutAttribute(attribute, callback)
This method calls a callback function for each specific layout attribute.Parameters:
- attribute [String] — the specific attribute
- callback [Function] — the function to call for each layout attribute
eachUnderlineLayoutAttribute(callback)
This method calls a callback function for each underline layout attribute.Parameters:
- callback [Function] — the function to call for each underline layout attribute
Class: PixMill.Viewport ← PixMill.MarkingObject
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2025, Brick Mill Games, LLC, all rights reserved. |
Overview
This class defines a viewport onto a PixMill.Canvas.
A PixMill.Viewport is primarily a layout object which sits directly on top of the underlying PixMill.Canvas' drawing context. It differs from a Canvas' rootbox in that it can have a graphics state applied. This allows for scaling and other positioning properties to be applied just prior to interactions with the drawing context.
Properties
The viewport marking object's property list is a 1-element array consisting of a zero-size bounding box at the specified origin point. This zero-size bounding box means no space for marking operations... ie: a viewport is not markable.Constructor Registry
Method Registry
Constructor Details
new PixMill.Viewport(parent, x, y)
Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- x [Number] — the x-coordinate of the origin point of the viewport within the underlying drawing context <default: 0>
- y [Number] — the y-coordinate of the origin point of the viewport within the underlying drawing context <default: 0>
Method Details
bbox() → PixMill.BoundingBox <overload>
This overload function returns the viewport's bounding box defined in its property list.Returns:
- [PixMill.BoundingBox] — the viewport's bounding box
set(parent, x, y) → PixMill.Viewport ⇏ RuntimeError <overload>
This overload method sets the properties of the the Viewport marking object.Parameters:
- parent [DrawingContext] — the underlying drawing context, which is a CanvasRenderingContext2D in this Javascript port
- x [Number] — the x-coordinate of the origin point of the viewport within the underlying drawing context <default: 0>
- y [Number] — the y-coordinate of the origin point of the viewport within the underlying drawing context <default: 0>
Returns:
- [PixMill.Viewport] — this viewport
Throws:
- [RuntimeError] — if the drawing context is not of an appropriate type (CanvasRenderingContext2D)
The WebFX Javascript Application UI Toolkit
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| accordionPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
| canvasPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
| colorPicker.js | Javascript | Kenneth F. Guerin | Copyright © 2024-2025 Brick Mill Games, LLC, All rights reserved. |
| datePicker.js | Javascript | Kenneth F. Guerin | Copyright © 2025 Brick Mill Games, LLC, All rights reserved. |
| dockPane.js | Javascript | Kenneth F. Guerin | Copyright © 2023-2024 Brick Mill Games, LLC, All rights reserved. |
| dropdownPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
| flowPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
| gridPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| hboxPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| menuPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| observers.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
| overlayPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| selectList.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| sliderControl.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
| slidingPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
| stackablePane.js | Javascript | Kenneth F. Guerin | Copyright © 2022-2024 Brick Mill Games, LLC, All rights reserved. |
| svgPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| tabPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| treeListPane.js | Javascript | Kenneth F. Guerin | Copyright © 2025 Brick Mill Games, LLC, All rights reserved. |
| vboxPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| webfx.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| windowPane.js | Javascript | Kenneth F. Guerin | Copyright © 2023-2024 Brick Mill Games, LLC, All rights reserved. |
Contents Directory
Class: DragEventObserver
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| observers.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
Overview
This class provides drag event handling for elements listening to drag-n-drop operations handled via the $.tracking singleton (see overlayPane.js)
Constructor Registry
Method Registry
Constructor Details
new DragEventObserver(callback)
Parameters:
- callback [Function] — this callback provides the application hook to handle drag events
Method Details
disconnect() <api>
This method implements the disconnect API defined for observers.observe() <api>
This method implements the observe API defined for observers.Class: MouseEventObserver
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| observers.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024, Brick Mill Games, LLC. All rights reserved. |
Overview
This class provides advanced mouse event handling for browser applications.
Constructor Registry
Method Registry
Constructor Details
new MouseEventObserver(callback)
Parameters:
- callback [Function] — this callback provides the application hook to handle advanced mouse events
Method Details
disconnect() <api>
This method implements the disconnect API defined for observers.observe() <api>
This method implements the observe API defined for observers.Namespace: WebFX
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| accordionPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
| canvasPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
| colorPicker.js | Javascript | Kenneth F. Guerin | Copyright © 2024-2025 Brick Mill Games, LLC, All rights reserved. |
| datePicker.js | Javascript | Kenneth F. Guerin | Copyright © 2025 Brick Mill Games, LLC, All rights reserved. |
| dockPane.js | Javascript | Kenneth F. Guerin | Copyright © 2023-2024 Brick Mill Games, LLC, All rights reserved. |
| dropdownPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
| flowPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
| gridPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| hboxPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| menuPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| overlayPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| selectList.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| sliderControl.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
| slidingPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
| stackablePane.js | Javascript | Kenneth F. Guerin | Copyright © 2022-2024 Brick Mill Games, LLC, All rights reserved. |
| svgPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| tabPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
| treeListPane.js | Javascript | Kenneth F. Guerin | Copyright © 2025 Brick Mill Games, LLC, All rights reserved. |
| vboxPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| webfx.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
| windowPane.js | Javascript | Kenneth F. Guerin | Copyright © 2023-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
The WebFX namespace encapsulates all definitions related to the family of WebFX classes used for browser-based application development.
Class: WebFX.AccordionPane ⟼ <accordion-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| accordionPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <accordionPane>
Constructor Registry
Class Property Registry
Method Registry
Constructor Details
new WebFX.AccordionPane()
The accordion-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Method Details
$activateSlot(nth) <private>
This private method is used to activate a particular accordion-slot.Parameters:
- nth [Integer] — the nth accordion-slot child to activate
$activateSlot(slotElement) <private>
This private method is used to activate a particular accordion-slot.Parameters:
- slotElement [HTMLElement] — the accordion-slot element to activate
$deactivate() <private>
This private method is used to deactivate the current active accordion-slot.$trigger(event) <private>
This private method is used to conduct actions based on a successful mouse click on an accordion-selector. The method will determine which accordion-slot is associated with the accordion-selector that was clicked.Parameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
For this control, nothing happens when an attribute is changed. The CSS handles look & feel changes.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets the mouse-click event listener.disconnectedCallback() <api>
Upon connection to the DOM, this method removes the mouse-click event listener.Class: WebFX.AccordionSelector ⟼ <accordion-selector>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| accordionPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <accordion-selector>
An accordion-selector is used with a accordion-pane's shadow DOM in order to allow the user to expand / contract the accordion-pane.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.AccordionSelector()
The accordion-selector constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
active ↔ Boolean
This property determines whether the accordion-selector is in the active state or not.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
For this control, nothing happens when an attribute is changed. The CSS handles look & feel changes.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings.disconnectedCallback() <api>
For this control, nothing happens when it is disconnected.Class: WebFX.AccordionSlot ⟼ <accordion-slot>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| accordionPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <accordion-slot>
An accordion-slot is used to define the contents of each block of information within an accordion-pane.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.AccordionSlot()
The accordion-slot constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
active ↔ Boolean
This property determines whether the associated accordion-selector is in the active state or not.heading ↔ String
This property sets the value of the associated accordion-selector in the shadow DOM.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'heading': change the accordion-selector's value based on the new heading value - 'active': show/hide the accordion-pane's contents and update the accordion-selector's active stateParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings and adds the private $trigger event listener.disconnectedCallback() <api>
For this control, nothing happens when it is disconnected.Class: WebFX.CanvasPane ⟼ <canvas-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| canvasPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <canvas-pane>
An canvas-pane encapsulates a canvas element.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.CanvasPane()
The canvas-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
drawProc ↔ Function
This property, set via the canvas-pane's "draw" attribute, is called in response to drawing events.factory ↔ Function
This property, set directly via JS code, is called in response to drawing events instead of the drawProc.resizable ↔ Boolean
This property determines if the canvas can be resized, true by default.ro ↔ ResizeObserver <private>
This internal property is used to track element size changes in order to redraw the content.Method Details
$configureCanvas() <private>
This private method will create the inner canvas based on the current dimensions of the enclosing div element.$redrawPane() <private>
This method will redraw the embedded SVG based either on the factory property or on the 'draw' attibute.attributeChangedCallback(name, oldValue, newValue) <api>
When the 'draw' attribute changes, the embedded SVG element will be replaced.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets the element's drawProc, sets the resizable to its default value of "true", if necessary, and sets the ResizeObserver to observe if the pane is resizable.disconnectedCallback() <api>
When this element is disconnected, the drawProc is removed and the ResizeObserver is set to unobserve if the pane is resizable.Class: WebFX.ColorPicker ⟼ <color-picker>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| colorPicker.js | Javascript | Kenneth F. Guerin | Copyright © 2024-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <color-picker>
Color picker controls are used to choose colors using a variety of input styles.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.ColorPicker()
The color-picker constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the ResizeObserver to react to changes in color-picker size and a MouseEventObserver to react to mouse events.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
apply ↔ Number
This property sets the apply procedure to call.rgb ↔ Number
This property manages the current RGB color value of the color-picker.value ↔ Number
This property manages the current value of the color-picker.Method Details
$colorValueToRGB(value) → Array<Integer> <private>
This method is used to convert the current color value to an RGB specification.Parameters:
- value [String] — the color value to convert
Returns:
- [Array<Integer>] — the converted RGB value
$findClosestPaletteColor(all) → String <private>
This method is used to find a palette entry containing a color value closest to the currentn color value.Parameters:
- all [Boolean] — searches all palettes, if true, and the current palette, if false
Returns:
- [String] — the name of the color which matches
$findExactPaletteColor(all) → String <private>
This method is used to find a palette entry containing the current color value.Parameters:
- all [Boolean] — searches all palettes, if true, and the current palette, if false
Returns:
- [String] — the name of the color which matches
$loadPaletteChoiceBox() <private>
This method is used to load a palette's color into the control's choice box.$rgbValueToRGB(rgb) → Array<Integer> <private>
This method is used to convert the current color value to an RGB specification.Parameters:
- rgb [String or Array<Integer>] — the RGB color value to convert
Returns:
- [Array<Integer>] — the converted RGB value
$setColorAsRGB(rgb, how) <private>
This method is used to set the current color as a name.Parameters:
- rgb [String or Array<Integer>] — the RGB color value to convert
- how [Integer] — the method to use to handle the conversion <default: 0>
$setColorAsValue(value, how) <private>
This method is used to set the current color as a name.Parameters:
- value [String] — the color value to convert
- how [Integer] — the method to use to handle the conversion <default: 0>
$setSliderValues() <private>
This method is used to set the slider values based on the current color.addPalette(name, palette)
This method is used to add a palette to the control's palette list.Parameters:
- name [String] — the name of the palette to add
- palette [Hash] — the palette contents indexed by color name.
attributeChangedCallback(name, oldValue, newValue) <api>
Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
disconnectedCallback() <api>
removePalette(name)
This method is used to remove a palette to the control's palette list.Parameters:
- name [String] — the name of the palette to remove
Class: WebFX.DatePicker ⟼ <date-picker>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| datePicker.js | Javascript | Kenneth F. Guerin | Copyright © 2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <date-picker>
Date picker controls are used to choose colors using a variety of input styles.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.DatePicker()
The date-picker constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the ResizeObserver to react to changes in date-picker size and a MouseEventObserver to react to mouse events.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
descending ↔ Boolean
This property manages the sort order of the year button.limits ↔ String
This property manages the legal date range limits.value ↔ Number
This property manages the current value of the date-picker.Method Details
$compare(a, b) → Integer <private>
This method is used to compare two dates.Parameters:
- a [String] — one date value
- b [String] — one date value <default: the current value>
Returns:
- [Integer] — the comparision value between the two date values
$configure() <private>
This method is used to set control button's submenu contents.$configureDate() <private>
This method is used to set date button's submenu contents based on the current month and year.$configureMonth() <private>
This method is used to set month button's submenu contents.$configureYear() <private>
This method is used to set year button's submenu contents.$dateOf(value) <private>
This method is used to extract the date portion of the specified value.Parameters:
- value [String] — the date value to process <default: the current value>
$loadValue() <private>
This method is used to load the current value by configuring the buttons and applying button labels.$monthOf(value) <private>
This method is used to extract the month portion of the specified value.Parameters:
- value [String] — the date value to process <default: the current value>
$setDate(date) <private>
This method is used to set the date portion of the current value.Parameters:
- date [String] — the date value to set
$setDate() <private>
This method is used to ensure that the current date value is within limits.$setMonth(month) <private>
This method is used to set the month portion of the current value.Parameters:
- month [String] — the month value to set
$setYear(year) <private>
This method is used to set the year portion of the current value.Parameters:
- year [String] — the year value to set
$today() <private>
This method is used to calculate today's date.$updateButtonLabels() <private>
This method is used to update the labels of each button based on the current value.$yearOf(value) <private>
This method is used to extract the year portion of the specified value.Parameters:
- value [String] — the date value to process <default: the current value>
attributeChangedCallback(name, oldValue, newValue) <api>
Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method loads the current value into the buttons and sets the button's callback procedures.disconnectedCallback() <api>
Class: WebFX.DockPane ⟼ <dock-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| dockPane.js | Javascript | Kenneth F. Guerin | Copyright © 2023-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <dock-pane>
Dock panes are panes which attach to the sides of a parent element.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.DockPane()
The dock-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
mode ↔ String
This property manages dock-pane's operating mode.side ↔ String
This property manages dock-pane's attachment side.trigger ↔ String
This property manages dock-pane's trigger size (when mode is 'auto-hide').triggerColor ↔ String
This property manages dock-pane's trigger border color.Method Details
$configure(set_hidden_value) <private>
This private API call sets the sizing and location and auto-hide trigger properties of the dock-pane.Parameters:
- set_hidden_value [Boolean or Null] — the value to set the auto-hide hidden state, or null to keep the setting unchanged <default: null>
$connect() <private>
This private API call, called on the connect event, configures the dock-pane properties that rely on the dock-pane being visible. It sets the mouse event handlers needed for auto-hide functionality.$disconnect() <private>
This private API call, called on the disconnect event or mode switch from auto-hide to static, removes the mouse event handlers needed for auto-hide functionality.$hide() <private>
This private API call hides the dock-pane, revealing only the trigger. It is called on mouseleave events.$show() <private>
This private API call shows the dock-pane, hiding the trigger region. It is called on mouseenter events.attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'side': change the dock-pane's docking side - 'mode': change the dock-pane's operating modeParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the auto-hide machinery.disconnectedCallback() <api>
Upon disconnection to the DOM, this method disables the auto-hide machinery.lock(open)
This function will lock a dock capable of auto-hiding into an open or closed position. This is useful when popup-menus are called from a button on such a dock.Parameters:
- open [Boolean] — the value to set the locked state of a dock capable of auto-hiding <default: true>
unlock()
This function will unlock a locked dock.Class: WebFX.DropDownSelector ⟼ <dropdown-selector>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| dropdownPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <dropdown-selector>
A dropdown-selector is used with a dropdown-pane's shadow DOM in order to allow the user to expand / contract the dropdown-pane.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.DropDownSelector()
The dropdown-selector constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
active ↔ Boolean
This property determines whether the dropdown-selector is in the active state or not.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
For this control, nothing happens when an attribute is changed. The CSS handles look & feel changes.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings.disconnectedCallback() <api>
For this control, nothing happens when it is disconnected.Class: WebFX.DropdownPane ⟼ <dropdown-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| dropdownPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <dropdown-pane>
The dropdown pane is a construct that allows for blocks of information within the web document or application to be hidden and/or shown by the user.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.DropdownPane()
The dropdown-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
expand ↔ Boolean
This property determines whether the dropdown-pane's content is visible or not.heading ↔ String
This property sets the value of the dropdown-selector in the shadow DOM.Method Details
$toggle()
This private method toggles the expand property's value between 'false' and 'true'.$trigger(event) <private>
This private method is used to toggle the state of the dropdown-pane if the mouse-click occured within the dropdown-selector.Parameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'heading': change the dropdown-selector's value based on the new heading value - 'expand': show/hide the dropdown-pane's contents and update the dropdown-selector's active stateParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings and adds the private $trigger event listener.disconnectedCallback() <api>
Upon disconnection from the DOM, this method removes event listeners.Class: WebFX.FlowPane ⟼ <flow-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| flowPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <flow-pane>
Flow panes are single-row flex boxes that are used to hold other elements.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.FlowPane()
The flow-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
align ↔ String
This property sets the flow-pane's item alignment when fillingcolumn-gap ↔ String
This property sets the flow-pane's item row and column when fillingdirection ↔ String
This property sets the flow-pane's direction when fillinggap ↔ String
This property sets the flow-pane's item row and column when fillinginline ↔ String
This property sets whether the flow-pane is an inline or block objectjustify ↔ String
This property sets the flow-pane's justify when fillingrow-gap ↔ String
This property sets the flow-pane's item row and column when fillingwrap ↔ String
This property sets the flow-pane's wrap when fillingMethod Details
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'direction': change the flow-pane's directionParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
This method marks the control as connected and configures it.disconnectedCallback() <api>
This method marks the control as disconnected.Class: WebFX.GridPane ⟼ <vbox-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| gridPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <grid-pane>
Grid panes are grids that are used to hold other elements.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.GridPane()
The grid-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
align ↔ String
This property manages grid-pane item's vertical positioning properties.column-gap ↔ String
This property manages grid-pane's intra-column spacing properties.column-spec ↔ String
This property manages grid-pane's column layout properties.gap ↔ String
This property manages grid-pane's intra-row/column spacing properties.justify ↔ String
This property manages grid-pane item's horizontal positioning properties.placement ↔ String
This property manages grid-pane item's justify/align properties.row-gap ↔ String
This property manages grid-pane's intra-row spacing properties.row-spec ↔ String
This property manages grid-pane's row layout properties.spec ↔ String
This property manages grid-pane's row/column layout properties.Method Details
$configureGrid() <private>
This method is used to set the various layout properties of the grid.attributeChangedCallback(name, oldValue, newValue) <api>
Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method configures the grid-pane's layout.disconnectedCallback() <api>
Class: WebFX.HBoxPane ⟼ <hbox-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| hboxPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <hbox-pane>
HBox panes are single-row grids that are used to hold other elements.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.HBoxPane()
The hbox-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
expand ↔ String
This property manages hbox-pane's expandability options.scrolling ↔ String
This property determines whether the vbox-pane's content is scrollable: none, vertical, horizontal, both.Method Details
$setExpansion() <private>
This method is used to set the expansion capability / layout of the control.$setScrolling() <private>
This method is used to set the scrolling capability / layout of the control.attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'expand': change the vbox-pane's expandability optionParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MutationObserverdisconnectedCallback() <api>
Upon disconnection to the DOM, this method disables the MutationObserverClass: WebFX.MenuButton ⟼ <menu-button>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <menu-button>
This type of button triggers a pop-up menu. Menu buttons must take <menu-pane> tags as children.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.MenuButton()
The menu-button constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the MutationObserver to react to changes in select-button content.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
abort ↔ Function
This property, set via code or the push-button's "abort" attribute, is called in response to an aborted menu operation.action ↔ Function
This property, set via code or the push-button's "action" attribute, is called in response to a valid menu selection.disabled ↔ Boolean
This property manages the push-button's ability to respond to events.This property manages the push-button's visibility.
label ↔ String
This property manages the menu button's textual representation.svg ↔ String
This property manages the SVG icon content representation of the push button.where ↔ String
This property manages the location of the popup menu in relation to the button.Method Details
$manageChildren() <private>
This private method is used to ensure that all children are option tags.$setContent() <private>
This private method is used to set the menu-button's content representation.$trigger(event) <private>
This private method is used to conduct actions based on a successful mouse click or key down event.Parameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
When the 'disabled' attribute has changed, add/remove event listeners based on the new value.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MutationObserver, sets the tabindex and enables the mouse event handlers.disable()
Disables the button's ability to respond to events.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disables the mouse event listeners and the MutationObserver.enable()
Enables the button's ability to respond to events.Class: WebFX.MenuPane ⟼ <menu-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| menuPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <menu-pane>
The menu pane is a construct that allows for popup-menus to be display and acted upon. Menu panes can contain other menu panes.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.MenuPane()
The dropdown-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the MutationObserver to react to changes in menu-pane content.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
inactive ↔ Boolean
This property determines the visibility of the menu-pane.level ↔ Integer
This property determines whether the dropdown-pane's content is visible or not.Method Details
$ensureActive() <private>
This private method is used to set the menu-pane's functionality when active. Among the primary functions is to ensure that the menu-pane's contents can be seen by adjusting its position and/or making its content area scrollable.$ensureFunctionality() <private>
This private method is used to set the menu-pane's functionality based on the inactive state.$ensureInactive() <private>
This private method is used to set the menu-pane's functionality when inactive.$manageChildren() <private>
This private method is used to manage the button's text based on its type, state and multichoice selection.attributeChangedCallback(name, oldValue, newValue) <api>
When the 'inactive' attribute has changed, update the UI and add/remove event listeners based on the new value.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method manages its children and sets the MutationObserver to observe changes.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disconnects from the MutationObserver.elementAt(x, y) → HTMLElement or Null
Parameters:
- x [Number] — the x-coordinate used to pinpoint the item
- y [Number] — the y-coordinate used to pinpoint the item
Returns:
- [HTMLElement or Null] — the nth tr element, or null if not found
has(element) → Integer or Null
Parameters:
- element [HTMLElement] — the element to find
Returns:
- [Integer or Null] — the index into the menu-pane where the element is, or null if not found
item(element) → HTMLElement or Null
Parameters:
- element [HTMLElement] — the element to find
Returns:
- [HTMLElement or Null] — the nth element, or null if not found
itemAt(x, y) → HTMLElement or Null
Parameters:
- x [Number] — the x-coordinate used to pinpoint the item
- y [Number] — the y-coordinate used to pinpoint the item
Returns:
- [HTMLElement or Null] — the nth menu-item element, or null if not found
locate(x, y) → Integer or Null
Parameters:
- x [Number] — the x-coordinate used to pinpoint the item
- y [Number] — the y-coordinate used to pinpoint the item
Returns:
- [Integer or Null] — the index into the menu-pane where the element is, or null if not found
shortcutValue(shortcut) → String
Parameters:
- shortcut [String] — the value of a menu-item's shortcut
Returns:
- [String] — the value of the 'value' attribute of the menu-item containing the given 'shortcut' attribute value
Class: WebFX.OverlayPane ⟼ <overlay-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| overlayPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <overlay-pane>
The overlayPane is used to manage modal-type operations for dialog boxes, popup menus and the like. Its primary purpose is to cover the entire web document / application at a high z-index and capture and forward mouse-click events, when applicable.
There are two modes: strict and non-strict. The former requires interaction with child elements, such as a dialog box's 'OK' button. The latter is looser and any click outside of any child elements will abort the whole operation. Popup menu operations are non-strict; a mouse-click outside of the menu acts as an escape from any choices.
This element also contains a menu handling subsystem that is used to properly manage popup menu operation.
This element, though not supported at this time, will also allow for "live tracking" operations, where children of this element will spawn events based on mouse movement and not require additional mouse clicks.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.OverlayPane()
The overlay-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates sets the closeHandler property to null.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
active ↔ Boolean
This property is used to determine if the overlay-pane is in operation.closeHandler ↔ Function
This property is used to store the closeHandler, a function called when the overlay-pane becomes inactive.strict ↔ Boolean
This property is used to determine if the overlay-pane is operating in strict mode.tracking ↔ Boolean
This property is used to determine if live tracking is being used.Method Details
$nsMouseDownHandler(event) <private>
In non-strict mode, this handler will abort the overlay-pane.Parameters:
- event [Object] — the mouse-down event
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'active': when set to false, the overlay-pane will detach itself and the closeHandler will be called - 'strict': this property will enable/disable the mouse-down event listeners for this element itself (enabled if false)Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
disconnectedCallback() <api>
This function removes the mouse-down and mouse-move event listeners.Class: WebFX.PushButton ⟼ <push-button>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <push-button>
Push buttons are simple text-based do-something-on-click buttons with the added optional capability to handle on/off toggle operations.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.PushButton()
The push-button constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the MutationObserver to react to changes in push-button content.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
action ↔ Function
This property, set via code or the push-button's "action" attribute, is called in response to events.callback ↔ Function
This property, set via code, is called in response to events prior to the push-button's action.disabled ↔ Boolean
This property manages the push-button's ability to respond to events.This property manages the push-button's visibility.
label ↔ String
This property manages the textual content representation of the push button, either set as an attribute or contained in the innerHTML.mo ↔ MutationObserver <private>
This internal property is used to track push-button content changes.svg ↔ String
This property manages the SVG icon content representation of the push button.Method Details
$manageChildren() <private>
This private method is used to manage the button's text based on its type, state and multichoice selection.$setContent() <private>
This private method sets the content representation of the button.$trigger(event) <private>
This private method is used to conduct actions based on a successful mouse click or key down event.Parameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
When the 'disabled' attribute has changed, add/remove event listeners based on the new value.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MutationObserver, sets the tabindex and enables the mouse event handlers.disable()
Disables the button's ability to respond to events.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disables the mouse event listeners and the MutationObserver.enable()
Enables the button's ability to respond to events.Class: WebFX.SelectButton ⟼ <select-button>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <select-button>
This type of button offers up a multiple-choice selection of values via a pop-up menu. Select buttons must take <option> tags as children.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.SelectButton()
The select-button constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the MutationObserver to react to changes in select-button content.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
action ↔ Function
This property, set via code or the push-button's "action" attribute, is called in response to events.disabled ↔ Boolean
This property manages the push-button's ability to respond to events.This property manages the push-button's visibility.
option ↔ String
This property manages the current selection of a multi-choice push-button by selecting an option based on its value.selected ↔ Integer
This property manages the current selection of a multi-choice push-button by selecting an option based on its index.Method Details
$manageChildren() <private>
This private method is used to ensure that all children are option tags.$trigger(event) <private>
This private method is used to conduct actions based on a successful mouse click or key down event.Parameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
When the 'disabled' attribute has changed, add/remove event listeners based on the new value.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MutationObserver, sets the tabindex and enables the mouse event handlers.disable()
Disables the button's ability to respond to events.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disables the mouse event listeners and the MutationObserver.enable()
Enables the button's ability to respond to events.next()
Sets the selected option to the next optionprevious()
Sets the selected option to the previous optionClass: WebFX.SelectItem ⟼ <select-item>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| selectList.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <select-item>
Select items are selectable items within a select-list.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.SelectItem()
The select-item constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
selected ↔ String
This property manages select-item's selected state.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings.disconnectedCallback() <api>
For this control, nothing happens when it is disconnected.Class: WebFX.SelectList ⟼ <select-list>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| selectList.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <select-list>
Select lists are single-column grids with selectable content.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.SelectList()
The select-list constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
callback ↔ Function
This property sets the selection callback function for interactive usage.selections → Array<String> <read-only>
This property gets the list of selections.stateless ↔ Boolean
This property manages whether the select list's items manage their own state.upto ↔ String
This property manages select-list's selection limit.Method Details
$select(event) <private>
This private method is used to select items in the select-list and save the selection values.Parameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'expand': change the select-list's expandability optionParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
clear()
Clears the selections listconnectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings and sets the click event listener.disconnectedCallback() <api>
Upon disconnection from the DOM, this method removes the click event listener.Class: WebFX.SliderControl ⟼ <slider-control>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| sliderControl.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <slider-control>
Slider controls are used to set numeric values between a set range.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.SliderControl()
The slider-control constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the ResizeObserver to react to changes in slider-control size and a MouseEventObserver to react to mouse events.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
clickAction ↔ String
This property manages the type of reaction to a click within the indicator track: { 'set','page' }.clickAmount ↔ Number
This property manages the paging amount, in a value between 0.0 and 1.0, when clickAction is set to page and snapToTicks is false.indicatorType ↔ String
This property manages the type of indicator: { 'round','cylinder','rsquare','rrect' }.majorTicks ↔ Integer
This property manages the number of major ticks used / displayed.minorTicks ↔ Integer
This property manages the number of minor ticks used / displayed between each major tick.onchange ↔ Function
This property manages the current callback procedure that is called when the slider-control's value has changed.ondrag ↔ Function
This property manages the current callback procedure that is called when the indicator is dragged.snapToTicks ↔ Boolean
This property manages the reaction to clicks in the indicator track if there are ticks present.tickColor ↔ Color
This property manages the color of the ticks used.tickStyle ↔ String
This property manages the style of ticks used: { 'top-left','bottom-right','both' }.trackColor ↔ String
This property manages the background color of the track.value ↔ Number
This property manages the current value of the slider-control.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the ResizeObserver and MouseEventObserver.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disables the ResizeObserver and MouseEventObserver.Class: WebFX.SlidingPane ⟼ <sliding-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| slidingPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <sliding-pane>
Sliding panes are multi-pane layout controllers used to adjust the widths of each pane by allowing the user to slide an inter-pane border.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.SlidingPane()
The sliding-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
sliderWidth ↔ Number
This property manages the width of the slider border.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'expand': change the vbox-pane's expandability optionParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the observers.disconnectedCallback() <api>
For this control, the observers will be disconnected upon control disconnection.Class: WebFX.StackablePane ⟼ <stackable-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| stackablePane.js | Javascript | Kenneth F. Guerin | Copyright © 2022-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <stackable-pane>
Stackable panes are single-column grids that are used to hold other elements.
Constructor Registry
Class Property Registry
Method Registry
Constructor Details
new WebFX.StackablePane()
The stackable-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings.disconnectedCallback() <api>
For this control, nothing happens when it is disconnected.Class: WebFX.StateButton ⟼ <state-button>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <state-button>
State buttons are used to transition through a given set of states. State buttons must take <state> tags as children.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.StateButton()
The state-button constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the MutationObserver to react to changes in state-button content.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
action ↔ Function
This property, set via code or the push-button's "action" attribute, is called in response to events.disabled ↔ Boolean
This property manages the push-button's ability to respond to events.This property manages the push-button's visibility.
value ↔ String
This property manages the current selection of a multi-choice push-button by selecting an option based on its value.Method Details
$manageChildren() <private>
This private method is used to manage the button's text based on its type, state and multichoice selection.$trigger(event) <private>
This private method transitions the state button to the next stateParameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
When the 'disabled' attribute has changed, add/remove event listeners based on the new value.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MutationObserver, sets the tabindex and enables the mouse event handlers.disable()
Disables the button's ability to respond to events.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disables the mouse event listeners and the MutationObserver.enable()
Enables the button's ability to respond to events.next(force)
Increments the stateParameters:
- force [Boolean] — if true, forces a trigger action even if the value doesn't change (single-state) <default: false>
reset(trigger)
Increments the stateParameters:
- trigger [Boolean] — if true, forces a trigger action <default: false>
Class: WebFX.SvgFactory
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| svgPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains a drawing registry used by the svg-pane element and its derivatives.
This factory is a drawing method registry used by svg-pane and its derivatives.
Constructor Registry
Method Registry
Constructor Details
new WebFX.SvgFactory()
The constructor creates the registry and installs the default factories.Method Details
$alertCircleIconFactory() → String <private>
This private method builds the alert circle icon using a path element.Returns:
- [String] — the SVG paths comprising the alert circle icon
$alertIconFactory() → String <private>
This private method builds the alert icon using a path element.Returns:
- [String] — the SVG paths comprising the alert icon
$alertRingIconFactory() → String <private>
This private method builds the alert ring icon using a path element.Returns:
- [String] — the SVG paths comprising the alert ring icon
$backstepIconFactory() → String <private>
This private method builds the back step icon using a path element.Returns:
- [String] — the SVG paths comprising the back step icon
$calendarIconFactory() → String <private>
This private method builds the calendar icon using a path element.Returns:
- [String] — the SVG paths comprising the calendar icon
$checkmarkIconFactory() → String <private>
This private method builds the checkmark icon using a path element.Returns:
- [String] — the SVG paths comprising the checkmark icon
$circleIconFactory() → String <private>
This private method builds the circle icon using a path element.Returns:
- [String] — the SVG paths comprising the circle icon
$closeIconFactory() → String <private>
This private method builds the close icon using a path element.Returns:
- [String] — the SVG paths comprising the close icon
$cloudDownloadIconFactory() → String <private>
This private method builds the cloud download icon using a path element.Returns:
- [String] — the SVG paths comprising the cloud download icon
$cloudIconFactory() → String <private>
This private method builds the cloud icon using a path element.Returns:
- [String] — the SVG paths comprising the cloud icon
$cloudUploadIconFactory() → String <private>
This private method builds the cloud upload icon using a path element.Returns:
- [String] — the SVG paths comprising the cloud upload icon
$diamondIconFactory() → String <private>
This private method builds the diamond icon using a path element.Returns:
- [String] — the SVG paths comprising the diamond icon
$downArrowIconFactory() → String <private>
This private method builds the down arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the down arrow icon
$downTriangleIconFactory() → String <private>
This private method builds the down triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the down triangle icon
$fileIconFactory() → String <private>
This private method builds the file icon using a path element.Returns:
- [String] — the SVG paths comprising the file icon
$fileViewIconFactory() → String <private>
This private method builds the file view icon using a path element.Returns:
- [String] — the SVG paths comprising the file view icon
$folderIconFactory() → String <private>
This private method builds the folder icon using a path element.Returns:
- [String] — the SVG paths comprising the folder icon
$fwdstepIconFactory() → String <private>
This private method builds the forward step icon using a path element.Returns:
- [String] — the SVG paths comprising the forward step icon
$gearIconFactory() → String <private>
This private method builds the gear icon using a path element.Returns:
- [String] — the SVG paths comprising the gear icon
$hamburgerIconFactory() → String <private>
This private method builds the hamburger icon using a multi-segment path element.Returns:
- [String] — the SVG paths comprising the hamburger icon
$hexagonIconFactory() → String <private>
This private method builds the hexagon icon using a path element.Returns:
- [String] — the SVG paths comprising the hexagon icon
$hollowCircleIconFactory() → String <private>
This private method builds the hollow circle icon using a path element.Returns:
- [String] — the SVG paths comprising the hollow circle icon
$hollowDiamondIconFactory() → String <private>
This private method builds the hollow diamond icon using a path element.Returns:
- [String] — the SVG paths comprising the hollow diamond icon
$hollowDownTriangleIconFactory() → String <private>
This private method builds the down triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the down triangle icon
$hollowHexagonIconFactory() → String <private>
This private method builds the hollow hexagon icon using a path element.Returns:
- [String] — the SVG paths comprising the hollow hexagon icon
$hollowLeftTriangleIconFactory() → String <private>
This private method builds the hollow left triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the hollow left triangle icon
$hollowOctagonIconFactory() → String <private>
This private method builds the hollow octagon icon using a path element.Returns:
- [String] — the SVG paths comprising the hollow octagon icon
$hollowRightTriangleIconFactory() → String <private>
This private method builds the right triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the right triangle icon
$hollowRsquareIconFactory() → String <private>
This private method builds the hollow rsquare icon using a path element.Returns:
- [String] — the SVG paths comprising the hollow rsquare icon
$hollowSquareIconFactory() → String <private>
This private method builds the hollow square icon using a path element.Returns:
- [String] — the SVG paths comprising the hollow square icon
$hollowUpTriangleIconFactory() → String <private>
This private method builds the up triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the up triangle icon
$homeIconFactory() → String <private>
This private method builds the home icon using a path element.Returns:
- [String] — the SVG paths comprising the home icon
$infoCircleIconFactory() → String <private>
This private method builds the info circle icon using a path element.Returns:
- [String] — the SVG paths comprising the info circle icon
$infoIconFactory() → String <private>
This private method builds the info icon using a path element.Returns:
- [String] — the SVG paths comprising the info icon
$infoRingIconFactory() → String <private>
This private method builds the info ring icon using a path element.Returns:
- [String] — the SVG paths comprising the info ring icon
$installDefaults() <private>
$leftArrowIconFactory() → String <private>
This private method builds the left arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the left arrow icon
$leftTriangleIconFactory() → String <private>
This private method builds the left triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the left triangle icon
$loginIconFactory() → String <private>
This private method builds the login icon using a path element.Returns:
- [String] — the SVG paths comprising the login icon
$logoutIconFactory() → String <private>
This private method builds the logout icon using a path element.Returns:
- [String] — the SVG paths comprising the logout icon
$minusIconFactory() → String <private>
This private method builds the minus icon using a path element.Returns:
- [String] — the SVG paths comprising the minus icon
$octagonIconFactory() → String <private>
This private method builds the octagon icon using a path element.Returns:
- [String] — the SVG paths comprising the octagon icon
$opacityMenuIconFactory() → String <private>
This private method builds the opacity menu icon using a path element.Returns:
- [String] — the SVG paths comprising the opacity menu icon
$opaqueIconFactory() → String <private>
This private method builds the opaque icon using a path element.Returns:
- [String] — the SVG paths comprising the opaque icon
$pauseIconFactory() → String <private>
This private method builds the pause icon using a path element.Returns:
- [String] — the SVG paths comprising the pause icon
$pencilIconFactory() → String <private>
This private method builds the pencil icon using a path element.Returns:
- [String] — the SVG paths comprising the pencil icon
$plusIconFactory() → String <private>
This private method builds the plus icon using a path element.Returns:
- [String] — the SVG paths comprising the plus icon
$powerIconFactory() → String <private>
This private method builds the power icon using a path element.Returns:
- [String] — the SVG paths comprising the power icon
$pushpinIconFactory() → String <private>
This private method builds the push pin icon using a path element.Returns:
- [String] — the SVG paths comprising the push pin icon
$questionCircleIconFactory() → String <private>
This private method builds the question circle icon using a path element.Returns:
- [String] — the SVG paths comprising the question circle icon
$questionIconFactory() → String <private>
This private method builds the question icon using a path element.Returns:
- [String] — the SVG paths comprising the question icon
$questionRingIconFactory() → String <private>
This private method builds the question ring icon using a path element.Returns:
- [String] — the SVG paths comprising the question ring icon
$redoArrowIconFactory() → String <private>
This private method builds the redo arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the redo arrow icon
$refreshArrowIconFactory() → String <private>
This private method builds the refresh arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the refresh arrow icon
$rightArrowIconFactory() → String <private>
This private method builds the right arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the right arrow icon
$rightTriangleIconFactory() → String <private>
This private method builds the right triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the right triangle icon
$rsquareIconFactory() → String <private>
This private method builds the rsquare icon using a path element.Returns:
- [String] — the SVG paths comprising the rsquare icon
$saveIconFactory() → String <private>
This private method builds the save icon using a path element.Returns:
- [String] — the SVG paths comprising the save icon
$searchIconFactory() → String <private>
This private method builds the search icon using a path element.Returns:
- [String] — the SVG paths comprising the search icon
$squareIconFactory() → String <private>
This private method builds the square icon using a path element.Returns:
- [String] — the SVG paths comprising the square icon
$swapArrowsIconFactory() → String <private>
This private method builds the swap arrows icon using a path element.Returns:
- [String] — the SVG paths comprising the swap arrows icon
$thinDownArrowIconFactory() → String <private>
This private method builds the thin down arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the thin down arrow icon
$thinLeftArrowIconFactory() → String <private>
This private method builds the thin left arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the thin left arrow icon
$thinRedoArrowIconFactory() → String <private>
This private method builds the thin redo arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the thin redo arrow icon
$thinRefreshArrowIconFactory() → String <private>
This private method builds the thin refresh arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the thin refresh arrow icon
$thinRightArrowIconFactory() → String <private>
This private method builds the thin right arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the thin right arrow icon
$thinSwapArrowsIconFactory() → String <private>
This private method builds the thin swap arrows icon using a path element.Returns:
- [String] — the SVG paths comprising the thin swap arrows icon
$thinUndoArrowIconFactory() → String <private>
This private method builds the thin undo arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the thin undo arrow icon
$thinUpArrowIconFactory() → String <private>
This private method builds the thin up arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the thin up arrow icon
$toggleDownIconFactory() → String <private>
This private method builds the toggle down icon using a path element.Returns:
- [String] — the SVG paths comprising the toggle down icon
$toggleIndentIconFactory() → String <private>
This private method builds the toggle indent icon using a path element.Returns:
- [String] — the SVG paths comprising the toggle indent icon
$toggleRightIconFactory() → String <private>
This private method builds the toggle right icon using a path element.Returns:
- [String] — the SVG paths comprising the toggle right icon
$translucentIconFactory() → String <private>
This private method builds the translucent icon using a path element.Returns:
- [String] — the SVG paths comprising the translucent icon
$transparentIconFactory() → String <private>
This private method builds the transparent icon using a path element.Returns:
- [String] — the SVG paths comprising the transparent icon
$trashCanIconFactory() → String <private>
This private method builds the trash can icon using a path element.Returns:
- [String] — the SVG paths comprising the trash can icon
$undoArrowIconFactory() → String <private>
This private method builds the undo arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the undo arrow icon
$upArrowIconFactory() → String <private>
This private method builds the up arrow icon using a path element.Returns:
- [String] — the SVG paths comprising the up arrow icon
$upTriangleIconFactory() → String <private>
This private method builds the up triangle icon using a path element.Returns:
- [String] — the SVG paths comprising the up triangle icon
$userIconFactory() → String <private>
This private method builds the user icon using a path element.Returns:
- [String] — the SVG paths comprising the user icon
$viewIconFactory() → String <private>
This private method builds the view icon using a path element.Returns:
- [String] — the SVG paths comprising the view icon
$zoomInIconFactory() → String <private>
This private method builds the zoom in icon using a path element.Returns:
- [String] — the SVG paths comprising the zoom in icon
$zoomMenuDownIconFactory() → String <private>
This private method builds the zoom menu icon using a path element.Returns:
- [String] — the SVG paths comprising the zoom menu icon
$zoomMenuRightIconFactory() → String <private>
This private method builds the zoom menu icon using a path element.Returns:
- [String] — the SVG paths comprising the zoom menu icon
$zoomOutIconFactory() → String <private>
This private method builds the zoom out icon using a path element.Returns:
- [String] — the SVG paths comprising the zoom out icon
draw()
install(name, proc)
This method is used to install a drawing procedure into the factory.Parameters:
- name [String] — the name of the drawing procedure
- proc [Function] — the drawing procedure to run
is_installed(name) → Boolean
This method is used to determine if a drawing procedure has been installedParameters:
- name [String] — the name of the drawing procedure
Returns:
- [Boolean] — true, if there is a drawing procedure registered under the give name
Class: WebFX.SvgIcon ⟼ <svg-icon>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| svgPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <svg-icon>
The svg-icon is a collection of useful icons. It is implemented as an extension of svg-pane using the pane's factory property to handle the drawing function.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.SvgIcon()
The svg-icon constructor executes the svg-pane's constructor and nothing else.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
baseType ↔ String
This property sets the base type.iconType ↔ String
This property sets the icon type.Method Details
$redrawPane() <private>
This method will redraw the embedded SVG based either on the factory property or on the 'draw' attibute or 'draw' callback.attributeChangedCallback(name, oldValue, newValue) <api>
When the 'icon' attribute changes, the icon will change.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets the svg-pane's factory property to handle drawing operations.disconnectedCallback() <api>
Mark the element as disconnected.Class: WebFX.SvgPane ⟼ <svg-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| svgPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <svg-pane>
An svg-pane encapsulates an SVG image.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.SvgPane()
The svg-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
drawProc ↔ Function
This property, set via the svg-pane's "draw" attribute, is called in response to drawing events.factory ↔ Function
This property, set directly via JS code, is called in response to drawing events instead of the drawProc.Method Details
$redrawPane() <private>
This method will redraw the embedded SVG based either on the factory property or on the 'draw' attibute or 'draw' callback.attributeChangedCallback(name, oldValue, newValue) <api>
When the 'draw' attribute changes, the embedded SVG element will be replaced.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets the element's drawProc.disconnectedCallback() <api>
When this element is disconnected, the drawProc is removed.Class: WebFX.TabPane ⟼ <tab-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| tabPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <tab-pane>
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.TabPane()
The tab-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
This property determines whether the tab pane contains and add button.
add_icon ↔ Boolean or String
This property determines the style of the add button on tab panes with add buttons.close_icon ↔ Boolean or String
This property determines the style of the close icon on closable tab panes.icon_style ↔ String
This property determines the style of close and add icons.onadd ↔ Null or Functions or String
This property determines a callback function to call when the add button is clicked.onclose ↔ Null or Functions or String
This property determines a callback function to call when a tab pane is closedstyle ↔ String
This property determines the look & feel of the tab-selectors. Valid values are 'top-tabs', 'top-buttons', 'top-cbuttons', 'bottom-tabs', 'bottom-buttons', 'bottom-cbuttons', 'left-tabs', 'left-buttons', 'left-cbuttons', 'right-tabs', 'right-buttons', 'right-cbuttons'.Method Details
$addAddButton() <private>
$deactivate() <private>
This private method is used to deactivate the current active tab-slot.$loadSelector(slot, selectorText, closable) <private>
This private method is used to attach a tab-slot to the tab-pane by creating its associated tab-selector.Parameters:
- slot [HTMLElement] — the tab-slot to attach to the tab-pane
- selectorText [String] — the string to load into the tab-selector
- closable [Boolean] — the flag which specifies whether a close icon will be part of the tab-selector or not
$removeAddButton() <private>
$trigger(event) <private>
This private method is used to conduct actions based on a successful mouse click on an tab-selector. The method will determine which tab-slot is associated with the tab-selector that was clicked.Parameters:
- event [Object] — the event received from the browser
$updateScrollability(scrolling) <private>
This private method is used to update the tab-content based on the active tab-slot's scrollability.Parameters:
- scrolling [String] — the scrolling direction
activateNthSlot(nth)
This method is used to activate a particular tab-slot.Parameters:
- nth [Integer] — the nth tab-slot child to activate
activateSlot(slotElement)
This method is used to activate a particular tab-slot.Parameters:
- slotElement [HTMLElement] — the tab-slot element to activate
attributeChangedCallback(name, oldValue, newValue) <api>
When the tab-style attribute is changed, the tab-pane will change its tab-selectors from one style to another.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
closeNthSlot(nth)
This method is used to close a particular tab-slot.Parameters:
- nth [Integer] — the nth tab-slot child to close
closeSlot(slotElement)
This method is used to close a particular tab-slot.Parameters:
- slotElement [HTMLElement] — the tab-slot element to close
connectedCallback() <api>
Upon connection to the DOM, this method sets the default tab-style to 'tabs' and sets the mouse-click event listener.disconnectedCallback() <api>
Upon connection to the DOM, this method removes the mouse-click event listener.Class: WebFX.TabSelector ⟼ <tab-selector>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| tabPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <tab-selector>
A tab-selector is used with a tab-pane's shadow DOM in order to allow the user to expand / contract the tab-pane.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.TabSelector()
The tab-selector constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
active ↔ Boolean
This property determines whether the tab-selector is in the active state or not.Method Details
$updateContents() <private>
This method is used to update the contents of the selector.attributeChangedCallback(name, oldValue, newValue) <api>
For this control, nothing happens when an attribute is changed. The CSS handles look & feel changes.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings.disconnectedCallback() <api>
For this control, nothing happens when it is disconnected.getCloseIcon() → String or Null
This method is used to get the close icon of the selector.Returns:
- [String or Null] — the type if icon to use for a closable icon, null if not closable
setCloseIcon(icon_style)
This method is used to set the close icon of the selector.Parameters:
- icon_style [String or Null] — the type if icon to use for a closable icon, null if not closable <default: null>
setContents(heading, icon_style)
This method is used to set the inner contents of the selector.Parameters:
- heading [String] — the string used to display in the selector tab
- icon_style [String or Null] — the type if icon to use for a closable icon, null if not closable <default: null>
setHeading(heading)
This method is used to set the heading of the selector.Parameters:
- heading [String] — the string used to display in the selector tab
Class: WebFX.TabSlot ⟼ <tab-slot>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| tabPane.js | Javascript | Kenneth F. Guerin | Copyright © 2021-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <tab-slot>
A tab-slot is used to define the contents of each block of information within an tab-pane.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.TabSlot()
The tab-slot constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
active ↔ Boolean
This property determines whether the associated tab-selector is in the active state or not.closable ↔ Boolean
This property determines whether the tab-slot's tab-selector will have a close icon or not.heading ↔ String
This property sets the value of the associated tab-selector in the shadow DOM.scrolling ↔ String
This property determines whether the slot's content is scrollable: none, vertical, horizontal, both.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'heading': change the tab-selector's value based on the new heading value - 'active': show/hide the tab-pane's contents and update the tab-selector's active state - 'closable': change whether the tab-slot's tab-selector will have a close iconParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method sets default attribute settings and adds the private $trigger event listener.disconnectedCallback() <api>
Upon disconnection from the DOM, this method removes event listeners.Class: WebFX.ToggleButton ⟼ <toggle-button>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <toggle-button>
Toggle buttons are used to transition between two states, showing on/off via an indicator.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.ToggleButton()
The push-button constructor executes the usual custom HTML initialization procedure by creating the shadow DOM. It also creates the MutationObserver to react to changes in push-button content.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
action ↔ Function
This property, set via code or the toggle-button's "action" attribute, is called in response to events.disabled ↔ Boolean
This property manages the push-button's ability to respond to events.This property manages the push-button's visibility.
Method Details
$manageChildren() <private>
This private method is used to manage the button's text based on its type, state and multichoice selection.$trigger(event) <private>
This private method is used to conduct actions based on a successful mouse click or key down event.Parameters:
- event [Object] — the event received from the browser
attributeChangedCallback(name, oldValue, newValue) <api>
When the 'disabled' attribute has changed, add/remove event listeners based on the new value.Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MutationObserver, sets the tabindex and enables the mouse event handlers.disable()
Disables the button's ability to respond to events.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disables the mouse event listeners and the MutationObserver.enable()
Enables the button's ability to respond to events.off()
This method toggles sets the toggle state to off.on()
This method toggles sets the toggle state to on.tap()
This method toggles the on/off state of a toggle button.Class: WebFX.TreeListPane ⟼ <tree-list-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| treeListPane.js | Javascript | Kenneth F. Guerin | Copyright © 2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <tree-list-pane>
TreeListPanes are grid-like display containers containing one or more expandable TreeListItems.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.TreeListPane()
The grid-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
caption ↔ String
This property manages the tree list's caption.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
Parameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method configures the grid-pane's layout.disconnectedCallback() <api>
Class: WebFX.VBoxPane ⟼ <vbox-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| vboxPane.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <vbox-pane>
VBox panes are single-column grids that are used to hold other elements.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.VBoxPane()
The vbox-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
expand ↔ String
This property manages vbox-pane's expandability options.scrolling ↔ String
This property determines whether the vbox-pane's content is scrollable: none, vertical, horizontal, both.Method Details
$setExpansion() <private>
This method is used to set the expansion capability / layout of the control.$setScrolling() <private>
This method is used to set the scrolling capability / layout of the control.attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'expand': change the vbox-pane's expandability optionParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MutationObserverdisconnectedCallback() <api>
Upon disconnection to the DOM, this method disables the MutationObserverClass: WebFX.WindowPane ⟼ <window-pane>
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| windowPane.js | Javascript | Kenneth F. Guerin | Copyright © 2023-2024 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains the implementation of the WebFX element: <window-pane>
Window panes are free-floating panes tied to a parent's visible area.
Constructor Registry
Class Property Registry
Property Registry
Method Registry
Constructor Details
new WebFX.WindowPane()
The window-pane constructor executes the usual custom HTML initialization procedure by creating the shadow DOM.Class Property Details
observedAttributes ↔ Array<String> <api>
This property lists the attributes that are managed as properties by this class.Property Details
closable ↔ Boolean
This property manages window-pane's ability to close itself.onfloat ↔ String or Function
This property sets a procedure to be called when the window-pane is floated to the toponmove ↔ String or Function
This property sets a procedure to be called when the window-pane is movedonresize ↔ String or Function
This property sets a procedure to be called when the window-pane is resizedresizable ↔ Boolean
This property manages window-pane's ability to resize itself.title ↔ String
This property manages window-pane's title string.title-background ↔ String
This property manages window-pane's banner background.title-color ↔ String
This property manages window-pane's banner color.title-font ↔ String
This property manages window-pane's banner font.Method Details
attributeChangedCallback(name, oldValue, newValue) <api>
When the following attribute values change: - 'closable': change the window-pane's closability option - 'resizable': change the window-pane's resizability option - 'mode': change the window-pane's positioning mode (absolute or relative) - 'title': change the window-pane's title - 'banner-background': change the window-pane's banner background - 'banner-color': change the window-pane's banner colorParameters:
- name [String] — the name of the attribute which has changed
- oldValue [Value] — the original value of the changed attribute
- newValue [Value] — the new value of the changed attribute
connectedCallback() <api>
Upon connection to the DOM, this method enables the MouseEventObserver.disconnectedCallback() <api>
Upon disconnection from the DOM, this method disables the MouseEventObserver.Class: WebFX$CommonButtonEnvironment
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pushButton.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025 Brick Mill Games, LLC, All rights reserved. |
Overview
This module contains all of the common event listeners.
The various types of buttons supported by WebFX contain several common data and functional elements. This class contains the necessary common css styling and html template body as well as the common mount event handling logic, disabled states and the MutationObserver.
Constructor Registry
Property Registry
Method Registry
Constructor Details
new WebFX$CommonButtonEnvironment()
The constructor for the common button support creates the common css and html template strings used by all buttons.Property Details
This property returns the button being managed.
content ↔ String
This property manages the button's content representation.css ↔ String
This property returns the button css styling string.disabled ↔ Boolean
This property manages the disabled state of the button and the associated mouse events.This property manages the push-button's visibility.
html ↔ String
This property returns the HTML template body.Method Details
$connectMouseEventListeners() <private>
Connects the standard mouse event listeners to the button element.$disconnectMouseEventListeners() <private>
Disconnects the standard mouse event listeners from the button element.$keyDownHandler(event) <private>
This private method handles key-down events and triggers the button's actions if the key was the 'Enter' key and the button had focus.Parameters:
- event [Object] — the event received from the browser
$mouseDownHandler(event) <private>
This private method puts the button in pressing mode when the left mouse button is pressed inside the button It uses the 'has-pressed' and 'pressing' attributes to manage its "being pressed" state. 'has-pressed' is used to note that the process has begun. 'pressing' is used for UI feedback.Parameters:
- event [Object] — the event received from the browser
$mouseOutHandler() <private>
This private method handles mouse out events while the push-button is being pressed. A drag of the mouse outside of the push-button while the mouse button is still pressed will modify the push-button's appearance and a release outside of the push-button will not trigger the push-button's action.$mouseOverHandler(event) <private>
This private method handles mouse over events after the push-button has been pressed. It can reset itself if the mouse button has been released outside of the push-button itself.Parameters:
- event [Object] — the event received from the browser
$mouseUpHandler() <private>
This private method ejects the button from pressing mode when the left mouse button is released.$preventDefault(event) <private>
This private method is used to signify to the browser's event machinery that we've captured and processed the event.Parameters:
- event [Object] — the event received from the browser
$trigger(event) <private>
This private method is used to trigger the button element's action via its $trigger call.Parameters:
- event [Object] — the event received from the browser
connect()
This method connects the mutation observer and standard mouse event listeners to the button element.disconnect()
This method disconnects the mutation obserer and the standard mouse event listeners from the button element.getContent() → String
This method gets the button's internal content representation.Returns:
- [String] — the button's content representation.
setContent(content)
This method sets the button's internal content representation.Parameters:
- content [String] — the string to place within the button, which could be an HTML snippet
Overview
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| sampleAppLoader.js | Javascript | Kenneth F. Guerin | Copyright © 2024, Brick Mill Games, LLC, all rights reserved. |
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025, Brick Mill Games, LLC. All rights reserved. |
Contents Directory
Library: xapi
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025, Brick Mill Games, LLC. All rights reserved. |
Overview
This library contains the Javascript eXtensible API.
This library contains a short-hand, extensible API that maps either to pre-existing Javascript DOM functions or to new functionality.
X-Method Registry
X-Method Details
Array.each(callback) <extends: Array>
This function calls a callback function on each item of the array.Parameters:
- callback [Function] — a callback function to call for each item in the array, breaks the loop if the callback returns false
Array.first() → String <extends: Array>
This function returns the first element of the array.Returns:
- [String] — the first element of the Array
Array.last() → String <extends: Array>
This function returns the last element of the array.Returns:
- [String] — the last element of the Array
Array.removeIf(callback) <extends: Array>
This function removes elements from the array based on the boolean results of the callback function.Parameters:
- callback [Function] — a callback function to call to determine if an element should be removed
CustomElementRegistry.extends(tagName, jsClassName) <extends: CustomElementRegistry>
This method is an alias for 'CustomElementRegistry.define', which creates a new custom element by extending from an existing element.Parameters:
- tagName [String] — the tag name of the custom element to define
- jsClassName [String] — the Javascript class name of the class that defines the operation of the custom element
CustomElementRegistry.getClass(tagName) → Constructor <extends: CustomElementRegistry>
This method is an alias for 'CustomElementRegistry.get'.Parameters:
- tagName [String] — the tag name of the custom element to define
Returns:
- [Constructor] — the constructor of the Javascript class which was used to define the custom element
CustomElementRegistry.register(tagName, jsClassName) <extends: CustomElementRegistry>
This method is an alias for 'CustomElementRegistry.define', which creates a new custom element w/o extending from an existing element.Parameters:
- tagName [String] — the tag name of the custom element to define
- jsClassName [String] — the Javascript class name of the class that defines the operation of the custom element
Document.createElementWithAttributes(tag, attrs) → HTMLElement <extends: Document>
This method calls document.createElement and sets the attributes by walking the specified attr hash and using setAttribute on each.Parameters:
- tag [String] — the element's tag name
- attrs [Hash] — the element's attributes represented by a key/value Hash object
Returns:
- [HTMLElement] — the HTMLElement created
Document.findStylesheet(basename) → StyleSheet or Null <extends: Document>
This method returns a stylesheet based on the specified filenameParameters:
- basename [String] — the pathless filename to search for
Returns:
- [StyleSheet or Null] — the stylesheet which has the basename as as the trailing part of its href
Document.htmlToElement(snippet) → HTMLElement or Null <extends: Document>
This method creates an HTML element from the given snippet of HTML text.Parameters:
- snippet [String] — the HTML snippet to convert to an HTMLElement
Returns:
- [HTMLElement or Null] — the HTMLElement (and subtree) described by the given valid HTML snippet
Document.loadImage(source) <extends: Document>
This method does an asynchronous deferred load of an image from the specified source.Parameters:
- source [String] — the source of the image
Document.qcfirst(name) → HTMLElement or Null <extends: Document>
This method returns the first element of a specified class, if it existsParameters:
- name [String] — the class name of the elements to find
Returns:
- [HTMLElement or Null] — the first element of the specified class
Document.qchildren(selector) → Array<HTMLNode> <extends: Document>
This method filters a call to Document.qsall to direct children.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [Array<HTMLNode>] — the 'non-live' list of HTML Nodes which satisfy the query
Document.qclass(name) → HTMLCollection <extends: Document>
This method is an alias for 'getElementsByClassName', which searches the document for elements with the specified tag.Parameters:
- name [String] — the class name of the elements to find
Returns:
- [HTMLCollection] — the 'live' collection of HTML Elements which are of the specified class
Document.qid(id) → HTMLElement or Null <extends: Document>
This method is uses the built-in querySelector to find an element with the given idParameters:
- id [String] — the id attribute of the element to find
Returns:
- [HTMLElement or Null] — the HTML Element with the specified 'id' attribute value (or Null if not found)
Document.qsall(selector) → NodeList <extends: Document>
This method is an alias for 'querySelectorAll', which searches the document for elements using the specified selector.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [NodeList] — the 'non-live' list of HTML Nodes which satisfy the query
Document.qsel(selector) → HTMLElement or Null <extends: Document>
This method is an alias for 'querySelector', which searches the document for elements using the specified selector.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [HTMLElement or Null] — the first element of the document which satisfies the query (or Null if not found)
Document.qsfirst(selector) → HTMLElement or Null <extends: Document>
This method uses qsall to return the array to find the first elementParameters:
- selector [String] — the query selector used for the search
Returns:
- [HTMLElement or Null] — the first element of the document which satisfies the query (or Null if not found)
Document.qslast(selector) → HTMLElement or Null <extends: Document>
This method uses qsall to return the array to find the last elementParameters:
- selector [String] — the query selector used for the search
Returns:
- [HTMLElement or Null] — the last element of the document which satisfies the query (or Null if not found)
Document.qtag(tag) → HTMLCollection <extends: Document>
This method is an alias for 'getElementsByTagName', which searches the document for elements with the specified tag.Parameters:
- tag [String] — the tag of the elements to find
Returns:
- [HTMLCollection] — the 'live' collection of HTML Elements which have the specified tag
Document.qxy(x, y, include_shadows) → Array<HTMLElement> or Null <extends: Document>
This method returns a list of elements at the specified point in the document in topmost visible order.Parameters:
- x [Number] — the document x-coordinate to be searched
- y [Number] — the document y-coordinate to be searched
- include_shadows [Boolean] — if true, will also include visible shadow DOM elements in the list <default: false>
Returns:
- [Array<HTMLElement> or Null] — the list of visible HTML Elements at the specified document coordinates (or Null if not found)
Document.walkElements(proc, xdata) <extends: Document>
This method calls document.body.walkElements() to traverse the entire document tree.Parameters:
- proc [Function] — the Javascript function to call for each element in the tree
- xdata [Data] — the optional external data element to pass to each proc call <default: Null>
Element.fqname() → String <extends: Element>
This method creates a fully-qualified name for the element, consisting of its tagName (converted to lower case), class names (prefixed with '.') and id (if defined, prefixed with '#').Returns:
- [String] — the fully qualified name of the element
Element.qcfirst(name) → HTMLElement or Null <extends: Element>
This method returns the first element of a specified class, if it existsParameters:
- name [String] — the class name of the elements to find
Returns:
- [HTMLElement or Null] — the first element of the specified class
Element.qchildren(selector) → Array<HTMLNode> <extends: Element>
This method filters a call to Element.qsall to direct children.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [Array<HTMLNode>] — the 'non-live' list of HTML Nodes which satisfy the query
Element.qclass(name) → HTMLCollection <extends: Element>
This method is an alias for 'getElementsByClassName', which searches the subtree for elements with the specified tag.Parameters:
- name [String] — the class name of the elements to find
Returns:
- [HTMLCollection] — the 'live' collection of HTML Elements which are of the specified class
Element.qid(id) → Element or Null <extends: Element>
This method is an alias for 'querySelector', which searches the subtree for the element with the specified 'id' attribute value.Parameters:
- id [String] — the id attribute of the element to find
Returns:
- [Element or Null] — the HTML Element with the specified 'id' attribute value (or Null if not found)
Element.qparent(tag) → Element or Null <extends: Element>
This method locates an ancestor element with the given tag.Parameters:
- tag [String] — the tag of the ancestor element to locate
Returns:
- [Element or Null] — the ancestor element with the given tag (or Null if not found)
Element.qsall(selector) → NodeList <extends: Element>
This method is an alias for 'querySelectorAll', which searches the subtree for elements using the specified selector.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [NodeList] — the 'non-live' list of HTML Nodes which satisfy the query
Element.qsel(selector) → Element or Null <extends: Element>
This method is an alias for 'querySelector', which searches the subtree for elements using the specified selector.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [Element or Null] — the first element of the document which satisfies the query (or Null if not found)
Element.qsfirst(selector) → HTMLElement or Null <extends: Element>
This method uses qsall to return the array to find the first elementParameters:
- selector [String] — the query selector used for the search
Returns:
- [HTMLElement or Null] — the first element of the document which satisfies the query (or Null if not found)
Element.qtag(tag) → HTMLCollection <extends: Element>
This method is an alias for 'getElementsByTagName', which searches the subtree for elements with the specified tag.Parameters:
- tag [String] — the tag of the elements to find
Returns:
- [HTMLCollection] — the 'live' collection of HTML Elements which have the specified tag
Element.walkElements(proc, xdata) <extends: Element>
This method visits every element in the subtree and calls the given procedure with the given external data.Parameters:
- proc [Function] — the Javascript function to call for each element in the subtree beginning with this element
- xdata [Data] — the optional external data element to pass to each proc call <default: Null>
Element.where() → Array<Element> <extends: Element>
This method returns this element's ancestry list of elements in the document from most distant to its immediate parent.Returns:
- [Array<Element>] — the array of this elements ancestry elements in order from most distant to its immediate parent
HTMLElement.appendHTML(snippet) <extends: HTMLElement>
This method appends an element (and its subtree) as described by the given HTML snippet into this element's children list.Parameters:
- snippet [String] — the HTML snippet
HTMLElement.detach() → HTMLElement <extends: HTMLElement>
This method removes itself from its parent.Returns:
- [HTMLElement] — this HTML Element
HTMLElement.getComputedStyle(properties) → Hash <extends: HTMLElement>
Ths method retrieves computed styles from the element.Parameters:
- properties [String or Array<String> or Null] — the properties to retrieve from the elements computed styles <default: null>
Returns:
- [Hash] — the requested style propertites, or all if null is specified
HTMLElement.getPageMappedXY(pageX, pageY, elist, index) → Object <extends: HTMLElement>
This function returns coordinate mappings of the targeted element referenced from its position in the viewable area and its effective position taking scrolling into account.Parameters:
- pageX [Number] — the x-coordinate of the location at the page / document level
- pageY [Number] — the y-coordinate of the location at the page / document level
- elist [Array<HTMLElement>] — the list of stacked elements to process <default: null>
- index [Integer] — the starting location within the elist to begin processing <default: 0>
Returns:
- [Object] — a Hash containing coordinate mappings
HTMLElement.hide() <extends: HTMLElement>
This method hides this element by settings its style's display attribute to 'none'.HTMLElement.insertAfterHTML(snippet) <extends: HTMLElement>
This method inserts an element (and its subtree) as described by the given HTML snippet after this element in its parent's children list.Parameters:
- snippet [String] — the HTML snippet
HTMLElement.insertBeforeHTML(snippet) <extends: HTMLElement>
This method inserts an element (and its subtree) as described by the given HTML snippet before this element in its parent's children list.Parameters:
- snippet [String] — the HTML snippet
HTMLElement.isNthChildOf(parent) → Integer or Null <extends: HTMLElement>
This method checks to see if this element is a child of the specified parent and where in the parent's children list the element is.Parameters:
- parent [HTMLElement] — the conjectured parent element
Returns:
- [Integer or Null] — the index within the parent's children list (or Null if the element is not a child of the specified parent)
HTMLElement.prependChild(child) <extends: HTMLElement>
This method inserts the child element into the parent's children list as the new first element.Parameters:
- child [HTMLElement] — the element to add as the element's first child
HTMLElement.prependHTML(snippet) <extends: HTMLElement>
This method prepends an element (and its subtree) as described by the given HTML snippet into this element's children list.Parameters:
- snippet [String] — the HTML snippet
HTMLElement.removeAllChildren(parent) → HTMLElememt <extends: HTMLElement>
This method removes all of an element's children.Parameters:
- parent [HTMLElement] — the conjectured parent element
Returns:
- [HTMLElememt] — the element
HTMLElement.removeElementsAfter() <extends: HTMLElement>
This method removes child elements after this element in its parent's children list.HTMLElement.removeElementsBefore() <extends: HTMLElement>
This method removes child elements before this element in its parent's children list.HTMLElement.reparent(newParent, at) <extends: HTMLElement>
This method removes itself from its current parent and attaches itself to a new parent.Parameters:
- newParent [HTMLElement] — the new parent element for this element
- at [Integer] — the optional index within the new parent's children list to insert this element <default: 0>
HTMLElement.replaceWithHTML(snippet) <extends: HTMLElement>
This method replaces this element with an element (and its subtree) as described by the given HTML snippet in its parent's children list.Parameters:
- snippet [String] — the HTML snippet
HTMLElement.rotateElements(firstToLast) <extends: HTMLElement>
This method rotates an element's children. If firstToLast is true, the first child become the last child. Else, the last child becomes the first child.Parameters:
- firstToLast [Boolean] — the direction of the rotation <default: true>
HTMLElement.show(type) <extends: HTMLElement>
This method displays this element by setting its style's display property to the given type, or 'block'Parameters:
- type [String] — the display style for this element <default: 'block'>
HTMLImageElement.load(source) <extends: HTMLImageElement>
This method does an asynchronous deferred load of an image into the HTMLImageElement.Parameters:
- source [String] — the source of the image
JSON.toString(obj) → String <extends: JSON>
This method is an alias for 'JSON.stringify' if the Javascript's implementation of JSON does not have a toString method.Parameters:
- obj [Object] — the object to convert to a JSON string
Returns:
- [String] — the JSON string which represents the given object
Object.clone() → Object <extends: Object>
This function clones an existing object.Returns:
- [Object] — a new cloned object
Object.eachKey(callback) <extends: Object>
This function calls a callback function for each key/property of the Object. If the callback function returns false, the iteration is aborted.Parameters:
- callback [Function] — a callback function to be called for each key/property of the Object
Object.eachValue(callback) <extends: Object>
This function calls a callback function for each value of the Object. If the callback function returns false, the iteration is aborted.Parameters:
- callback [Function] — a callback function to be called for each value of the Object
Object.extend(obj) → Object <extends: Object>
This function extends the given object with new properties supplied from the specified source object.Parameters:
- obj [Object] — an object whose properties will be merged with the current object
Returns:
- [Object] — the original object extended
Object.first() → Array<Any> <extends: Object>
This function returns the list of values in the Object.Returns:
- [Array<Any>] — the list of values in the Object
Object.hasKey(key) → Boolean <extends: Object>
This function returns true if the given key is defined within the Object.Parameters:
- key [String] — the name of the key/property to test the existance of within the object
Returns:
- [Boolean] — true if the key exists within the Object
Object.key() → String <extends: Object>
This function returns the name of the first key/property of the Object.Returns:
- [String] — the first key/property of the Object
Object.klist() → Array<String> <extends: Object>
This function returns the list of keys/properties in the object.Returns:
- [Array<String>] — the list of keys/properties in the Object
Object.merge(obj) → Object <extends: Object>
This function returns a new object based on properties from the source object and the specified object.Parameters:
- obj [Object] — an object whose properties will be used to build a new object
Returns:
- [Object] — a new object containing properties from both objects
Object.value() → String <extends: Object>
This function returns the name of the first value of the Object.Returns:
- [String] — the first element of the Object
Set.symmetricDifference(other) → Set <extends: Set>
This function determines the symmetric difference between two Sets.Parameters:
- other [Set] — the other set to compare against
Returns:
- [Set] — a set containing the symmetric difference between this set and the other one
ShadowRoot.qcfirst(name) → HTMLElement or Null <extends: ShadowRoot>
This method returns the first element of a specified class, if it existsParameters:
- name [String] — the class name of the elements to find
Returns:
- [HTMLElement or Null] — the first element of the specified class
ShadowRoot.qchildren(selector) → Array<HTMLNode> <extends: ShadowRoot>
This method filters a call to ShadowRoot.qsall to direct children.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [Array<HTMLNode>] — the 'non-live' list of HTML Nodes which satisfy the query
ShadowRoot.qclass(name) → HTMLCollection <extends: ShadowRoot>
This method is an alias for 'getElementsByClassName', which searches the shadow root for elements with the specified tag.Parameters:
- name [String] — the class name of the elements to find
Returns:
- [HTMLCollection] — the 'live' collection of HTML Elements which are of the specified class
ShadowRoot.qid(id) → HTMLElement or Null <extends: ShadowRoot>
This method is an alias for 'querySelector', which searches the shadow root for the element with the specified 'id' attribute value.Parameters:
- id [String] — the id attribute of the element to find
Returns:
- [HTMLElement or Null] — the HTML Element with the specified 'id' attribute value (or Null if not found)
ShadowRoot.qsall(selector) → NodeList <extends: ShadowRoot>
This method is an alias for 'querySelectorAll', which searches the shadow root for elements using the specified selector.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [NodeList] — the 'non-live' list of HTML Nodes which satisfy the query
ShadowRoot.qsel(selector) → HTMLElement or Null <extends: ShadowRoot>
This method is an alias for 'querySelector', which searches the shadow root for elements using the specified selector.Parameters:
- selector [String] — the query selector used for the search
Returns:
- [HTMLElement or Null] — the first element of the document which satisfies the query (or Null if not found)
ShadowRoot.qsfirst(selector) → HTMLElement or Null <extends: ShadowRoot>
This method uses qsall to return the array to find the first elementParameters:
- selector [String] — the query selector used for the search
Returns:
- [HTMLElement or Null] — the first element of the document which satisfies the query (or Null if not found)
ShadowRoot.qslast(selector) → HTMLElement or Null <extends: ShadowRoot>
This method uses qsall to return the array to find the last elementParameters:
- selector [String] — the query selector used for the search
Returns:
- [HTMLElement or Null] — the last element of the document which satisfies the query (or Null if not found)
ShadowRoot.qtag(tag) → HTMLCollection <extends: ShadowRoot>
This method is an alias for 'getElementsByTagName', which searches the shadow root for elements with the specified tag.Parameters:
- tag [String] — the tag of the elements to find
Returns:
- [HTMLCollection] — the 'live' collection of HTML Elements which have the specified tag
ShadowRoot.qxy(x, y) → Array<HTMLElement> or Null <extends: ShadowRoot>
This method returns a list of elements at the specified point in the document in topmost visible order.Parameters:
- x [Number] — the document x-coordinate to be searched
- y [Number] — the document y-coordinate to be searched
Returns:
- [Array<HTMLElement> or Null] — the list of visible HTML Elements at the specified document coordinates, including the shadow DOM of the given element (or Null if not found)
ShadowRoot.qxys(x, y, deep) → Array<HTMLElement> or Null <extends: ShadowRoot>
This method returns a list of elements within a given element's shadow DOM at the specified point in the document in topmost visible order.Parameters:
- x [Number] — the document x-coordinate to be searched
- y [Number] — the document y-coordinate to be searched
- deep [Boolean] — if true, add contained element's shadow DOMs as well
Returns:
- [Array<HTMLElement> or Null] — the list of visible HTML Elements in the hosting element's shadow DOM at the specified document coordinates (or Null if not found)
String.fmt() → String <extends: String>
This function formats the incoming arguments into a string suitable for output, similar to the C function sprintf().Returns:
- [String] — the formatted string
String.makeHtmlSnippet(tag, attrs, inner) → String <extends: String>
This function formats the incoming arguments into a string suitable for output, similar to the C function sprintf().Parameters:
- tag [String] — the name of the element to create
- attrs [String or Array<String> or Function] — a string, an array of attribute/value pairs or a function which will return the attr-string <default: ''>
- inner [String or Function] — a string or function which will return a string which will serve as the inner content of the element <default: ''>
Returns:
- [String] — the formatted string
Namespace: xapi.AJAX
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025, Brick Mill Games, LLC. All rights reserved. |
Overview
The AJAX namespace encapsulates network interactions with a remote server.
The AJAX namespace encapsulates network interactions with a remote server. Even though it is called AJAX, it relies on the newer fetch API.
Function Registry
Function Details
AJAX.fetch(url, payload, method) → Promise
This method is a wrapper for the fetch API.Parameters:
- url [String] — the URL of the server to communicate with
- payload [String] — the communications payload
- method [String] — the communications method <default: POST>
Returns:
- [Promise] — the Promise object which will resolve to a Response object
Namespace: xapi.AppLoader
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025, Brick Mill Games, LLC. All rights reserved. |
Overview
The AppLoader namespace encapsulates dynamic resource loading operations on app start.
Function Registry
Function Details
AppLoader.load(callback, prime)
The AppLoader namespace encapsulates dynamic resource loading operations.Parameters:
- callback [Function] — a function that loads app resources via multiple stages.
- prime [Varargs] — extra arguments that will get passed to the callback during the stage 0 pipeline priming step
Class: xapi.ArgumentError ← Error
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025, Brick Mill Games, LLC. All rights reserved. |
Overview
This class extends the Error exception by categorizing it as an ArgumentError.
Namespace: xapi.ResLoader
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025, Brick Mill Games, LLC. All rights reserved. |
Overview
The ResLoader namespace encapsulates dynamic script loading operations.
The ResLoader namespace encapsulates dynamic script loading operations.
Function Registry
Function Details
ResLoader.load(src, async, callback)
This method loads a script into a script element and appends it to the document's head.Parameters:
- src [String] — the script src
- async [Boolean] — if true, loads the script asynchronously <default: false>
- callback [Proc] — the callback to call when the script is loaded <default: null>
ResLoader.require(list)
This function loads a list of scripts asynchronously to the document's head. The pipeline ensures that downstream requirements are inserted at the head of the list.Parameters:
- list [Varargs] — the list of resources to load
ResLoader.setChangeCallback(callback)
This function sets a callback function to be called whenever the internal requirements pipeline is added to.Parameters:
- callback [Function] — the callback function, arguments are: the internal requirements array
ResLoader.setCompletionCallback(callback)
This function sets a callback function to be called whenever a resource has been processed, whether loaded successfully or not.Parameters:
- callback [Function] — the callback function, arguments are: the item loaded and its process status (true if successful)
ResLoader.setFinishCallback(callback)
This function sets a callback function to be called whenever the requirements array is emptyParameters:
- callback [Function] — the callback function, no arguments
Class: xapi.RuntimeError ← Error
File Manifest
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| xapi.js | Javascript | Kenneth F. Guerin | Copyright © 2020-2025, Brick Mill Games, LLC. All rights reserved. |
Overview
This class extends the Error exception by categorizing it as an RuntimeError.
NCS Color Table
CSpec: -
Hex: -
RGB: -
Resene Color Table
CSpec: -
Hex: -
RGB: -
W3C Color Table
CSpec: -
Hex: -
RGB: -