- Home /
Background Image in 2D
Hi,
I want to make a background image, for example in 2D where there is starfield behind the ship. All the help I found on Answers is to create GUI texture... etc which doesn`t exist anymore.
Do you know other way how to do it?
GUITexture still exists but it is not what you need there. Sprite I would guess is the way to go in 2D.
What's wrong with creating a quad in the background and assigning the starfield texture onto its material?
Yeah I used sprite, however lets say I would like to move it a bit when player moves. I don`t need script for moving the X and Y of that image, only how to make so the image is repetable in camera.
Place many of them aligned. With a script you could place like 3 of them and when you reach a certain distance from the leftest (is that english?) move it to the far right.
If placing many of them seems like a waste, try and you will see that it won't affect much.
Yes, you'll need a script to move them with a sprite, but you need a script for pretty much everything don't you?
I did this exact thing and used script to move the background along. I added a little trigger on the far left to send the images back to the far right as they touch it. sounds wierd but it works perfect. And its only a few lines of code to move to the left and to bouce it back to the right
If someone knows how to make it repeating using camera configuration I would be keen to learn.
Answer by RayJr · Nov 18, 2014 at 12:38 PM
Hi, just add the background image as a sprite and set the sorting layer to the very bottom.