sschmid / Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
MIT License
7k stars 1.11k forks source link

Visual debugging. Coloring components not working properly. #1090

Open OutdoorHawk opened 1 month ago

OutdoorHawk commented 1 month ago

Describe the bug Coloring components on the entity does not work at a display scale of more than 100%.

To Reproduce Steps to reproduce the behavior:

  1. Entitas 1.14.1, Windows 11, Unity 2022.3.22f1.
  2. Go to display settings -> Scale & Layout -> Scale -> Set anything more than 100%.
  3. Open & Run your project with at least 1 entity -> Open visual debugging of an entity.
  4. Components on the entity are not coloring into different colors.

Expected behavior Components on the entity are coloring into different colors at any display scale.

Screenshots image image image

Additional context To enable colors again you need to set scale to 100% and restart project. The problem is important because it is extremely inconvenient to use 100% scale on many monitors, due to the high resolution. The problem with exact same behaviour have been confirmed by at least three people besides me.

sschmid commented 1 month ago

Hi, thanks for the issue. I removed colored components a while back when preparing Entitas 2.0. Versions after 1.14.x won't have colored components anymore. In case you want to patch it for your project, here's the code that creates the colored texture for boxstyle

https://github.com/sschmid/Entitas/blob/1.14.1/src/Entitas.VisualDebugging.Unity.Editor/src/Entity/Entity/EntityDrawerState.cs#L125-L156

and it's used when drawing a component here: https://github.com/sschmid/Entitas/blob/1.14.1/src/Entitas.VisualDebugging.Unity.Editor/src/Entity/Entity/EntityDrawer.cs#L151

OutdoorHawk commented 1 month ago

Hi, thanks for getting in touch. Cool, I would try to work with this code. But, I still don't quite understand how I can make changes to the code, since I use Entitas from releases and the code is packaged in a dll.

By any chance, there are no recent instructions on how to use Entitas with source code in a project? I tried to replace the dll with the source code several times, but I encountered many errors.