Skip to content

Conversation

@AGulev
Copy link
Contributor

@AGulev AGulev commented Jan 24, 2026

Added outline and properties view, so user see what exactly elements added on the scene

CleanShot.2026-01-24.at.08.29.46.mp4

Also, Fixes #2

@@ -1,57 +1,273 @@
-- Copyright 2020-2026 The Defold Foundation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated render script

if action_id == hash("mouse_button_left") and action.released then
local id = factory.create("#factory", vmath.vector3(action.x, action.y, 0))
local world_pos = camera.screen_xy_to_world(action.screen_x, action.screen_y)
local id = factory.create("#factory", world_pos)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proper coordinates conversion to camera one (I added camera to the scene as well)

@@ -0,0 +1,450 @@
#define EXTENSION_NAME codepad_scene_dump
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the most optimal one, but it isn't the goal
Also use strings here, for simplicity

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a scene graph dump extension some time ago:

https://github.com/britzl/extension-scene-graph

Not sure if it is helpful or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to avoid cpp->lua->js data passing, so I serialize data get it on js size directly to keep just cpp->js
Also, it contains a lot of filters to avoid serialization of data isn't needed in the codepad.

But extension looks great! I didn't know about it

Copy link
Contributor

@britzl britzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add some comments to the new functions in codepad.js and describe briefly what each function does? This file has grown quite large by now and it would be helpful to get an explanation of each function.

@AGulev AGulev requested a review from britzl January 24, 2026 08:57
@AGulev
Copy link
Contributor Author

AGulev commented Jan 24, 2026

I moved outline into a separate js file and added comments to functions. codepad.js contains just minimal changes now

@andsve
Copy link

andsve commented Jan 24, 2026

Cool!

@AGulev AGulev merged commit f2482fa into master Jan 24, 2026
1 check passed
@AGulev AGulev deleted the codepad-0.2 branch January 24, 2026 13:29
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.

Improve render script so that it works well with cameras

4 participants