Unity3D, how i repeat the background image?

Lazarus

I try to repeat the background image on the GUILayout. After i search from the website, not able find out how to repeat the image.

is that can tell me why? or how i can make the windows background image able to auto fill?

below is my code.

Texture2D LzIMGBackground;
    LzIMGBackground = Resources.LoadAssetAtPath("Assets/Textures/UI/Resources/metal-background-texture.jpg",typeof(Texture2D)) as Texture2D;
    GUILayout.BeginVertical (LzIMGBackground, "box");
    GUILayout.BeginVertical ("box");
    if(GUILayout.Button("Single Player",GUILayout.Width(200))){
        Application.LoadLevel("testGUITransitions");
    }
    GUILayout.EndVertical ();

    GUILayout.BeginVertical ("box");
    if(GUILayout.Button("Quit",GUILayout.Width(200))){
        Application.Quit();
    }
    GUILayout.EndVertical ();
    GUILayout.EndVertical ();

and i had attach the file for example. thanks a lot.

Sample Image

Arturo Volpe

From this you need to use the 'GUI.DrawTextureWithTexCoords' function

var panelWidth = ...; 
var panelHeight = ...;
yourTexture.wrapMode = TextureWrapMode.Repeat;

GUI.DrawTextureWithTexCoords(panelPos, yourTexture, 
    new Rect(0, 0, screenBounds.width / yourTexture.width, panelHeight / yourTexture.height));

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I repeat a pattern image to create a background in React Native?

From Dev

How to repeat background image as a block

From Dev

How to get a transparent background image to repeat

From Dev

How to get a transparent background image to repeat

From Dev

How to convert EmguCV Image to Unity3D Sprite?

From Dev

How to repeat only one part of my sprites image as a background for div

From Dev

How to repeat only one part of my sprites image as a background for div

From Dev

How can I output Unity3D debug log?

From Dev

How can I check if the level is loaded in Unity3D

From Dev

How do I get touch working in Unity3D?

From Dev

How can I load another level in unity3d?

From Dev

How do I install the latest Unity3D beta?

From Dev

How do I make a stop effect in Unity3D?

From Dev

Background repeat will cause the image to repeat in a weird way

From Dev

How to draw a monochromatic background in a 2d game with unity3d?

From Dev

How do I set background image to a Canvas

From Dev

How do I make a background image responsive?

From Dev

How would i make background image fade in?

From Dev

how can I set a background image in code?

From Dev

How do I remove the background from an image?

From Dev

how can I change the background of this image?

From Dev

How do I add a background image to a JPanel?

From Dev

How do I change the background image in pygame?

From Dev

how do I zoom a background image on a div with background-size

From Dev

No background image with Ubuntu 18.04.1 with i3

From Dev

How do I make a sliced image the background-image of the body?

From Dev

Unity3d new UI: How to set button's interactable zone bigger than the attached image?

From Dev

How to send GUI texture behind a image having sprite renderer component in unity3D 4.5

From Dev

Unity, How to set the sprite in front the background Image?

Related Related

  1. 1

    How can I repeat a pattern image to create a background in React Native?

  2. 2

    How to repeat background image as a block

  3. 3

    How to get a transparent background image to repeat

  4. 4

    How to get a transparent background image to repeat

  5. 5

    How to convert EmguCV Image to Unity3D Sprite?

  6. 6

    How to repeat only one part of my sprites image as a background for div

  7. 7

    How to repeat only one part of my sprites image as a background for div

  8. 8

    How can I output Unity3D debug log?

  9. 9

    How can I check if the level is loaded in Unity3D

  10. 10

    How do I get touch working in Unity3D?

  11. 11

    How can I load another level in unity3d?

  12. 12

    How do I install the latest Unity3D beta?

  13. 13

    How do I make a stop effect in Unity3D?

  14. 14

    Background repeat will cause the image to repeat in a weird way

  15. 15

    How to draw a monochromatic background in a 2d game with unity3d?

  16. 16

    How do I set background image to a Canvas

  17. 17

    How do I make a background image responsive?

  18. 18

    How would i make background image fade in?

  19. 19

    how can I set a background image in code?

  20. 20

    How do I remove the background from an image?

  21. 21

    how can I change the background of this image?

  22. 22

    How do I add a background image to a JPanel?

  23. 23

    How do I change the background image in pygame?

  24. 24

    how do I zoom a background image on a div with background-size

  25. 25

    No background image with Ubuntu 18.04.1 with i3

  26. 26

    How do I make a sliced image the background-image of the body?

  27. 27

    Unity3d new UI: How to set button's interactable zone bigger than the attached image?

  28. 28

    How to send GUI texture behind a image having sprite renderer component in unity3D 4.5

  29. 29

    Unity, How to set the sprite in front the background Image?

HotTag

Archive