Add adds a new entity to the MouseSystem. * RenderComponent is only required if you're using the HUDShader on this Entity. * SpaceComponent is required whenever you want to know specific mouse-events on this Entity (like hover, click, etc.). If you don't need those, then you can omit the SpaceCompon
(basic *ecs.BasicEntity, mouse *MouseComponent, space *SpaceComponent, render *RenderComponent)
| 157 | // * MouseComponent is always required. |
| 158 | // * BasicEntity is always required. |
| 159 | func (m *MouseSystem) Add(basic *ecs.BasicEntity, mouse *MouseComponent, space *SpaceComponent, render *RenderComponent) { |
| 160 | m.entities = append(m.entities, mouseEntity{basic, mouse, space, render}) |
| 161 | } |
| 162 | |
| 163 | // AddByInterface adds the Entity to the system as long as it satisfies, Mouseable. Any Entity containing a BasicEntity,MouseComponent, and RenderComponent, automatically does this. |
| 164 | func (m *MouseSystem) AddByInterface(i ecs.Identifier) { |