wyozi-gmod / imgui

Immediate mode 3D2D UI for Garry's Mod
MIT License
79 stars 21 forks source link

Any chance of an examples folder? #11

Open The-GenghisJohn opened 4 years ago

The-GenghisJohn commented 4 years ago

Been trying to figure this out. Want to attach this to a "models/hunter/plates/plate2x4.mdl" entity and have a sort of placeable scoreboard. I honestly cant figure out how to parent it to the entities position and angle, I also can't figure out how to make my entity still visible as well.

I figure a couple quick examples would do to help me figure this out.

wyozi commented 4 years ago

Good idea although I don't have time to do that right now.

For attaching to entity, the "Using it inside an entity:" example in README should be the general way to do it. Note that position and angles there are relative to the entity orientation. You can also check https://github.com/wyozi-gmod/imgui/issues/4 for an example orientation for a specific model to start with.

Pdzly commented 3 years ago

if its still needed i think you want to do that? it will parent it to then entity (self)

Vector(0, 0, 50) = 0 pixel moved in X, 0 pixel moved in Y, 50 pixel moved in Z ( so that its not overlapping with the entity)

Angle(0, 90, 90) = so that its on the front side of the prop

if imgui.Entity3D2D(self, Vector(0, 0, 50), Angle(0, 90, 90), 0.1) then -- render things

imgui.End3D2D()