-
Notifications
You must be signed in to change notification settings - Fork 6
Codepad 0.2 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codepad 0.2 #14
Conversation
| @@ -1,57 +1,273 @@ | |||
| -- Copyright 2020-2026 The Defold Foundation | |||
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
britzl
left a comment
There was a problem hiding this 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.
|
I moved outline into a separate js file and added comments to functions. codepad.js contains just minimal changes now |
|
Cool! |
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