Physics stage 2: colliders gain the shapes capsule and polygon, a polygon keeps its corners in the property points, turns, scales and mirrors with its object and is edited in the scene view (drag a corner, click an edge to insert one, double-click to delete, at least three stay, each step one undo step), a concave polygon is split into convex parts, a self-intersecting one is drawn red and collides with nothing, Rapier gets a capsule and one convex collider per part on the same body, and Move and the editor run use our own f64 geometry for the new shapes, where on a tie between two normals the one that blocks the move least wins, so a box no longer stops at the foot of a slope (#151); first version of a collision outline per texture frame, edited in the texture tab with the new Collision toggle, which a plain tile blocks with instead of its rectangle (#141, to be reworked)
game-maker / gate (push) Successful in 1m52s
game-maker / suite (push) Successful in 6m41s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-18 22:56:25 +02:00
1 parent 1b5e386b60
commit 32057a96fc
25 files changed
+2341 -122

No files matched your search

+5 -1
View File
@@ -16,6 +16,8 @@ export interface ButtonOptions {
padding?: number;
/** Text style of the label when the button is not on an accent fill. */
style?: TextStyleToken;
/** Switched on and off by its owner (`setToggled`): measured for the bold label it shows when on. */
toggle?: boolean;
onClick?: () => void;
}
@@ -32,6 +34,7 @@ export class Button extends Widget {
protected readonly fixedWidth: number;
private readonly padding: number;
private readonly style: TextStyleToken;
private readonly toggle: boolean;
onClick?: () => void;
constructor(text: string, options: ButtonOptions = {}) {
@@ -47,6 +50,7 @@ export class Button extends Widget {
this.padding = options.padding ?? Theme.padding;
this.fullText = text;
this.style = options.style ?? 'body';
this.toggle = options.toggle ?? false;
this.labelText = new Text({ text, style: textStyle(this.variant === 'primary' ? 'accent' : this.style) });
this.addChild(this.bg, this.labelText);
@@ -104,7 +108,7 @@ export class Button extends Widget {
// From the full label, never the on-screen one: measuring truncated text would keep a button
// that was once too narrow too narrow for good.
// Measured bold where it can be drawn bold (on an accent fill), or a danger or toggled tab truncates.
const style = textStyle(this.variant === 'default' ? this.style : 'accent');
const style = textStyle(this.variant === 'default' && !this.toggle ? this.style : 'accent');
const metrics = CanvasTextMetrics.measureText(this.fullText, style);
return { w: Math.max(this.minWidth, Math.ceil(metrics.width) + this.padding * 2), h };
}