Posted September 17, 20232 yr In ItemTooltipEvent, it seemed that I can only add the instance of Component to the List<Component>. So how to render image in tooltip?
September 20, 20232 yr Create a class that implements TooltipComponent, which holds the data necessary for the rendering. Create a class that implements ClientTooltipComponent. This class should have a public constructor with only your TooltipComponent implementation as argument. Use RegisterClientTooltipComponentFactoriesEvent, so the game knows which ClientTooltipComponentneeds to be created, when an item has the TooltipComponent added to it. You can use the previosly mentioned constructor as your factory method. Add your TooltipComponent to the tooltip render pipeline with RenderTooltipEvent.GatherComponents. This is at least how I solved it. Anyone can correct me, if I made an error. Edited September 20, 20232 yr by Tavi007
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.