# Self rendering objects?

**URL:** <https://discourse.processing.org/t/self-rendering-objects/4427>\
**Category:** Coding Questions\
**Created:** [October 13, 2018, 2:42pm UTC](https://discourse.processing.org/t/self-rendering-objects/4427 "2018-10-13T14:42:06Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [October 26, 2018, 4:40pm UTC](https://discourse.processing.org/t/self-rendering-objects/4427/6 "2018-10-26T16:40:58Z")

</div>

Right, it depends on your goals: if you want your objects to be autonomously self-rendering, they should have what they need.

An interesting recent counter-use-case was this animated text stream.

> [@Animated text / Spacing problem](https://discourse.processing.org/t/animated-text-spacing-problem/4559/4):
>
> You are storing absolute coordinates (x, y) in your Letter class - but there is no way for each letter to know its cumulative offset without giving it a way to check the list of all the letters to the left of it. Its absolute position shouldn’t be its job. Instead, you want a cursor variable or class. Each time a letter is printed, it knows its own width (because the textSize is set) – at that moment, it needs to tell the cursor how wide it is, and the cursor will advance by that much. Then pr…

OP set out to make the letter autonomously renderable, but that was needlessly complex – in fact, they were always being rendered relative to an accumulation of shifting previous objects, so one alternate approach that made sense was for them not to store their own location, but instead be positioned in a typing stream.

Of course, that approach makes more sense if you are changing the locations of every object every frame or constantly re-sequencing – not common for most GUI control elements.

---

_[View the full topic](https://discourse.processing.org/t/self-rendering-objects/4427)._
