Feb
2
2024
2
2024
UI: Make Tooltip background fit Text content length
An article by mgear
No Comments
- 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
- 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
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)
Recent Comments
@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