UCA User Interface Design & Implementation 2 — Questions and Answers
Question 1: Which Unity UI component is used to display a non-interactive image or sprite on the canvas?
- Image (Correct answer)
- RawImage
- SpriteRenderer
- Texture2D
Correct answer: Image
The Image component is the standard UI element for displaying sprites in the Unity UI (uGUI) system.
Question 2: What does the 'Interactable' property on a Unity UI Button control?
- Whether the button receives pointer events and can be clicked (Correct answer)
- Whether the button is visible on screen
- Whether the button plays a sound on click
- Whether the button can be dragged
Correct answer: Whether the button receives pointer events and can be clicked
Setting Interactable to false disables the button so it no longer responds to user input events.
Question 3: In Unity's UI Toolkit, what file format is used to define the visual structure of a UI document?
- UXML (Correct answer)
- XML
- HTML
- JSON
Correct answer: UXML
UXML (Unity Extensible Markup Language) is the XML-based format used in UI Toolkit to define UI hierarchy.
Question 4: Which Canvas Render Mode should you use when you want UI elements to appear in 3D world space and be occluded by game objects?
- World Space (Correct answer)
- Screen Space - Overlay
- Screen Space - Camera
- Perspective
Correct answer: World Space
World Space mode places the Canvas as a 3D object in the scene, allowing other game objects to occlude it.
Question 5: What Unity component automatically adjusts a child element's size to fill its parent RectTransform?
- Content Size Fitter (Correct answer)
- Layout Element
- Horizontal Layout Group
- Aspect Ratio Fitter
Correct answer: Content Size Fitter
Content Size Fitter resizes a RectTransform to fit the size of its content automatically.
Question 6: Which event in Unity's EventSystem interface is triggered when a pointer first enters a UI element's bounds?
- IPointerEnterHandler (Correct answer)
- IPointerDownHandler
- IPointerClickHandler
- IPointerHoverHandler
Correct answer: IPointerEnterHandler
IPointerEnterHandler's OnPointerEnter callback fires the moment the cursor moves into the element's rect.
Question 7: In the uGUI system, what is the purpose of a Graphic Raycaster component on a Canvas?
- It detects which UI elements are being clicked or touched (Correct answer)
- It renders UI graphics to the screen
- It casts shadows from UI elements onto 3D objects
- It optimizes UI draw calls by batching
Correct answer: It detects which UI elements are being clicked or touched
The Graphic Raycaster casts rays to detect pointer interactions with UI elements on its Canvas.
Which Unity UI component is used to display a non-interactive image or sprite on the canvas?