Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

The Ornamented Ovum

A topic by Internet Janitor created Apr 07, 2023 Views: 309 Replies: 2
Viewing posts 1 to 3
Developer(+4)(-100)

I felt inspired this evening to make a silly little egg-decorating sandbox, The Ornamented Ovum:

Show me your best eggs!

If anyone is interested in making parts for their own paper-doll kits with Decker, all you need to do is:

  1. Draw something.
  2. If necessary, switch to "Transparency Mask" mode and fill/paint any areas that need to be opaque white.
  3. Select your drawing and copy it to the clipboard.
  4. Switch to the widget tool and choose "Edit -> Paste as new Canvas".
  5. Make your new canvas widget borderless, draggable, and shown transparent.

All together:


Lather, rinse, and repeat for each part. If you want to borrow pieces from The Ornamented Ovum, don't forget you can copy and paste widgets between decks!

Developer(+1)

Eoin2 asked how we might add a button to take a screenshot of a decorated egg. Let's work through it step-by-step!

I've added an invisible canvas named "outline" to the card. This will both allow us to define a rectangular portion of the card to export (rather than the entire card) and give us a scratchpad for compositing:


As a starting point, let's look at writing out images in general, with the following script on a button:


Running this script will prompt the user to save an image, which will contain the entire background of the current card. Let's instead "copy[]" from the card background, based on the dimensions of the "outline" canvas:


Pattern 0 (which normally looks white in a card background) is transparent in the output image. If we want it to be opaque, we can map[] this pattern to 32 ("opaque white") before writing the image out:


OK, we can save parts of the card background. What about our egg, and everything else on the card?

One approach is to draw all the widgets of the card on our canvas in sequence, back-to-front, and offset to reflect the position of "outline". Drawing fields is a bit trickier than canvases, but we don't need to handle every possible option here:


Another approach entirely is to (ab)use a custom transition function. Transition functions are given a rendered image of the entire card (and the destination card) to mix together, so we can perform a "fake" transition that stashes our card image for safekeeping and then, as a flourish, draws a little shutter animation. When the transition completes, we save the piece of the card image we're interested in.

One complication here is that editable fields will be drawn in a "disabled" state while transition animations are played. As long as we lock the "name" field before the transition and restore it afterward, no one will be the wiser.


I went with the second approach, mainly for the visual pizzaz.

And there you have it, easy egg-exports! If anyone has further questions I'm happy to clarify.


(+2)

Haha I love it!