Skip to content

Add brush_position_anchor - #9113

Merged
4ian merged 4 commits into
claude/gdevelop-ai-extensions-95js2mfrom
claude/youthful-keller-dpbyeh
Sep 16, 2026
Merged

4ian merged 4 commits into
claude/gdevelop-ai-extensions-95js2mfrom
claude/youthful-keller-dpbyeh

Conversation

@4ian

@4ian 4ian commented Sep 16, 2026

Copy link
Copy Markdown
Owner

No description provided.

`brush_position` positions the ORIGIN of an instance, which for a 3D model is
the origin the model was authored with - usually near its middle, not the corner
of its box. The agent placed every part of a tank as if the position were the
minimum corner, and the turret ended 16px behind the hull and flush with its
edge: the arithmetic needs an origin nothing tells before the objects are
placed.

`put_2d_instances`/`put_3d_instances` now take a `brush_position_anchor`
(`origin` by default, `min_corner`, `center`, and `bottom_center` in 3D): each
instance is moved by its own size so that the point named lands on the brush
position, which needs nothing to be known of the origin and makes two parts
centered on each other the same position. It is refused, rather than guessed,
when the size or the origin of the object is unknown (a 3D model that could not
be read included).

`fit_area_to_children` also reports where each child ended up (its box and its
middle) and what the custom object turns around: the center of its area, or its
own position with `centered_on_origin`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuhWWcQTYqEwUG5RWdsCqi
A text is as big as what it displays: nothing knows its box until an instance
is given a size, and an anchor on it would place it anywhere. Covered by a test,
which also shows `instances_size` making the anchor work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuhWWcQTYqEwUG5RWdsCqi
…ng apart

`getNearby("Missile", "Tank", 100000)` kept every missile of the run
`01M2NHQ3SHVYRE4BAWYJPMW6Q5`, so the test asserting a missile near the tank
passed while it was spawning a thousand pixels away. A radius reaching further
than the whole screen AND letting every instance through says nothing about
where they are: the run now reports it, whatever the assertions concluded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuhWWcQTYqEwUG5RWdsCqi
…e really are

Two messages stated as unconditional what the engine only does by default:

- the position semantics of a custom object scope said (0;0) IS the position of
  the custom object and that it turns around the center of its area. The engine
  turns the children around its center of rotation - the center of the area
  unless its own events set another one - so the rendered place of the local
  (0;0) is its position only when that center is at (0;0), the scale is 1 and
  nothing is flipped. It now says (0;0) is the origin of the object's own space,
  names the center of rotation, and says a position taken out of the object is
  not a scene position until the whole transform is applied to it.
- `fit_area_to_children` reported the center of the area as the center of
  rotation, full stop.

No behavior change: these are the messages the agent reads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CuhWWcQTYqEwUG5RWdsCqi
@4ian
4ian marked this pull request as ready for review September 16, 2026 20:47
@4ian
4ian merged commit 71ac2ec into claude/gdevelop-ai-extensions-95js2m Sep 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants