Defold Codepad

#1

How many of you know about https://godbolt.org/ ?
It’s a great site I use a lot to see what different compilers do to the code I write. It’s quite informative.

And, perhaps you didn’t know we have a similar tool, for Defold, called codepad: https://defold.com/codepad/

With it, you can choose a collection, write some test code, and then see the result.

The source is available on github, and we’d very much like to see this way of writing quick examples grow even further:
https://github.com/defold/codepad

To post an example, you put it in an iframe:

<iframe width="100%" height="800" frameborder="0" scrolling="no" marginheight="0"
 marginwidth="0" src="CODEPAD_URL"></iframe>

And the CODEPAD_URL is the one you get from pressing “Share” in the code pad.

And here’s what it looks like.

18 Likes

listed #2
0 Likes

#3

One good way to use this would be to infuse our documentation with small codepad links that explain the behavior of a function or a concept, interactively.

6 Likes

#4

I use the codepad all the time when I need to find out how exactly something embarassingly simple works and don’t want to test it in the project I have open at the moment.

5 Likes

#5

This will come in handy, for sure.

I think your links have issues, though. They all appear to be Slack redirects, which don’t work for me.

0 Likes

#6

Fixed!

0 Likes

#7

:open_mouth::heart_eyes_cat: wow this is great!

0 Likes

#8

I’m in <3, this is like https://codepen.io/ but with Defold!

“Try it here or host your own custom version.”

Where to start if I wanted to host my custom version? With the possibility also of sharing code URLs?
I don’t know nothing about web servers programming. I only know about getting shared hosting plans and installing Wordpress :stuck_out_tongue: !

0 Likes

#9

A good solution is to use GitHub Pages: https://pages.github.com/

That is how we host the website and codepad.

1 Like

#10

Do I need to do something special to make the “share” button work?
When people click share, the code need to be saved somewhere and a new URL is created. Is all this handled by the codepad app?

0 Likes

#11

The url contains the settings + code as base 64 encoded info (iirc)

1 Like

#12

:heart_eyes_cat::open_mouth::heart_eyes_cat::open_mouth: oh! great!

0 Likes