ambrosiogabe / MathAnimation

A simple C++/OpenGL application to create quick and dirty mathematically accurate animations
982 stars 49 forks source link

Add better object grouping for text/code objects #101

Open ambrosiogabe opened 1 year ago

ambrosiogabe commented 1 year ago

For text objects and code blocks the tree hierarchy panel in the editor should probably look something like this (where the animation objects group words/code blocks appropriately):

"TextObject" {
  "Text": "Here's <color=\"Yellow\">some</color> text!"
}

And here's the resulting tree

Here's some text!
| -> Here's
| ---> H
| ---> e
| ---> r
| ---> ...
| -> some
| ---> s
| ---> o
| ---> ...
| -> text!
| ---> t
| ---> e
| ---> ...

And for a codeblock

"CodeBlock": {
  "Text": "int void main(int argc) { printf(\"Hello world!\"); }"
}

The resulting tree:

int void main(int argc) { printf("Hello world!") }
| -> int
| ---> i
| ---> ...
| -> void
| ---> v
| ---> ...
| main()
| ---> main
| ------> m
| ------> a
| ------> ...
| ---> (
| ------> int
| ---------> i
| ---------> ...
| ------> argc
| ---------> a
| ---------> ...
| ---> )
| -> {
| ---> printf
| ------> p
| ------> ...
| ---> (
| ------> "Hello world!"

So on and so forth...