- Home /
How to make the playing field separate from the ui?
So, I'm having trouble figuring out how to create the playing field in unity. I'm looking at games like Candy Crush or Minesweeper (to name a few) and I see that the playing field is separate from the score/ui elements. Is there is way to create a playing field to hold the game and have a section on the right or left side of the screen to display the score and lives left?
I've attached images to describe my question in further details. I want to create an area in my game view that simply holds the "board" (the part in black).
Answer by Brogan89 · Jul 27, 2017 at 02:22 AM
Option 1:
Create a png that has a transparent window (this will show the game), add a Image gameobject in the scene stretch it to all 4 corners and BOOM you have created boarder around you're screen. Make sure you turn RaycastTarget off because you want to be able to interact with whatever is in the window.
On top of the "boarder" you can other UI elements, and anchor it in such a way that they only stay confined to the bounds of the boarder. It should be very simple.
Option 2
Create 4 Image objects, and apply them down each side of the screen. Then you can leave RaycastTarget on, because you don't want to be able to click through them (so it acts as boarder) ... probably the best option.
Your answer
![](https://koobas.hobune.stream/wayback/20220612131250im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Game launches as background process in windows 2012 0 Answers
How do i make my game to focus on the IN game menu instead of the gameplay 2 Answers
Unity 3D vertical scrolling background 1 Answer
getting udp package info inside unity (GlovePIE) 0 Answers
World hierarchy doesn't finish destroying before starting a new world? 1 Answer