Feb
2
2024
2
2024
UI: Make Tooltip background fit Text content length

- Add UI/Panel as background
- Set pivot to Top Left
- Add Text as Child of the Panel
- Add Content Size Fitter to Panel
- Add Horizontal Layout Group to Panel (Enable: Control Child Size: [x] Width, [x] Height, Child Force Expand: [x] Width, [x] Height)
- Content size fitter: Horizontal Fit: Preferred Size, Vertical Fit: Unconstrained (if you want 1 line only) or Preferred Size for multiline)
- Set some text value to child text component, Panel should resize to it
Related Posts
Leave a comment
Recent posts
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
- Detect SRP (URP or HDRP) with Assembly Definition Version Defines
- [LudumDare57] Theme: Depths
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
Recent Comments
- Using RenderDoc with Unity (graphics debugger) on
- UI Scroll View automatic Content height on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
@unitycoder_com
My TweetsSubscribe to Blog via Email
Tag Cloud
2d
3D
AI
algorithm
android
asset
build
color
custom
demo
editor
effect
error
fake
free
game
generator
greasemonkey
indie
javascript
light
line
ludumdare
mesh
paint
particles
physics
plugin
proto
prototype
script
sea
shader
shadow
sprite
terrain
texture
tutorial
ui
unity
vertex
visibility
water
waves
webgl