massimo

massimo

I’ve tweeted this yesterday and it’s getting some attention, so I decided to post it here to share comments, ideas and answer questions, if anybody got some :slight_smile:

The tweet can be found here
https://twitter.com/wstucco/status/1046485501774057473

What I did is write a custom Scene module and a custom Component model on top of Scenic, reusing and extending Scenic’s own Scene and Component modules, that automatically keep track of component creation and can communicate.
The Scene has an internal list of children components and send to each of them an :animation_frame message on regular intervals, the interval is the amount of milliseconds coming out from the formula

trunc(1_000 / FPS * multiplier)

Note:
The timing is not perfect yet, 60 FPS generate an interval of 16ms, which is actually 62.5 FPS
I’m starting a series of posts on this argument and the first one will about writing a Timer that has resolution in the microseconds instead of milliseconds (I’ve managed to have an std deviation of about 30 microseconds at 60 FPS)

You can find some more information on this thread
https://twitter.com/BoydMulterer/status/1046497642442678272

I will use this post as placeholder to post about progresses in the area of pixel animation without having access to pixels

I’ll post the code of the project as soon as I’ll be back home on my couch

With Scenic Elixir enters in the arena of GUI applications and it does in a pretty spectacular way

First Post!

AstonJ

AstonJ

This is awesome - well done!! :023:

Most Liked

massimo

massimo OP

I’ve just completed another little challenge

This time I’ve implemented the color cycling effect natively in Elixir and Scenic

All the code, including decoding and re-encoding the PNGs and their palettes is pure Elixir

I will release it soon on Gitlab

For those who don’t know what color cycling is

Color cycling , also known as palette shifting , is a technique used in computer graphics in which colors are changed in order to give the impression of animation. This technique was mainly used in early computer games, as storing one image and changing its palette required less memory and processor power than storing the animation as several frames

I was heavily inspired by this demo

https://twitter.com/wstucco/status/1051168787347705856

16
Post #8
massimo

massimo OP

Code is online for those interested :slight_smile:

massimo

massimo OP

@AstonJ @amnu3387

The code is online :slight_smile:

Last Post!

massimo

massimo OP

Hi!

Sorry for being so late, unfortunately I’ve been really busy at work and couldn’t find enough time to write something on the topic.

In the meantime I’ve experimented with some ideas and adapted the code to the new version of Scenic and will be back ASAP.

Thanks for your interest!

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New
dillonoconnor
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
thiagogsr
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews