Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up system for tinting units #58

sderickson opened this issue Jan 3, 2014 · 1 comment

Set up system for tinting units #58

sderickson opened this issue Jan 3, 2014 · 1 comment


Copy link

sderickson commented Jan 3, 2014

With the vector artwork system, we can manipulate sprites in fun ways without having to download or generate multitudes of sprite maps. One of the key things we want to do is be able to take a given Thang and tint certain parts of it. For example, give Ogres a different skin color, or humans different colored shirts, or wizards different colored robes. There are many things that need to get done for this vision to be realized:

  1. Need a way to specify and set these values. In the Thang editor, we should be able to create color groups, where each group has a name and a set of shapes. I imagine an interface with:
    1. one Treema column for managing groups and their names
    2. another Treema column with a list of shapes with checkboxes for which ones are part of that color group that is selected in the first column, and
    3. a Surface showing the thang where, if one of the left columns is selected, it's highlighting either the shapes in the selected group or the single selected shape (maybe showing the selected shape(s) fully opaque while the rest is semi-transparent). This would be in a separate tab from the main one that's there now.
    4. Controls below the surface for testing the selected color group. So you have a hue slider which can be used to control what the color group looks like when adjusted.
  2. Get the ThangType Model to be able to take in its spriteSheet options what the colors are for the given set. That is, it could receive an options object like {colors:{team:0}} and that would mean the team color is red (the 0 is a hue value of HSL). It will also incorporate these color settings with the caching system so there can be, say, blue and red tinted sprites at the same time.
  3. Hook this up to the Components/Systems and Surface. @nwinter, do you have an idea how this would go?
Copy link

nwinter commented Jan 4, 2014

Perhaps you'd add a display.Tinted Component to do coloring outside of teams. (I added a ui.Tinted placeholder that doesn't do anything before we added the Display System, which is a better place for it.) The Alliance System would probably also let you configure which colors belonged to which teams/superteams, as well as what the names of those teams were. (Currently they're kind of autogenerated from what the alliance.Allied Components happen to say the teams are within a level.)

All these Components/Systems need to do is attach a single tintHue property to their Thangs / teams.

@ghost ghost assigned sderickson Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants