- Home /
Question by
KururuLABO · Feb 14, 2014 at 02:12 AM ·
guitextureborderwithout
How to draw gui without border?
Hi i try to drawing texture but texture have a border.
This my java script
#pragma strict
var frameTexture : Texture;
var frameWidth = 174;
var frameHeight = 33;
var frameMarginLeft : int = 10;
var frameMarginTop: int = 10;
function Start () {
}
function Update () {
}
function OnGUI()
{
GUI.DrawTexture( Rect(frameMarginLeft,frameMarginTop, frameMarginLeft + frameWidth,frameMarginTop + frameHeight), frameTexture, ScaleMode.ScaleToFit, true, 0 );
}
Comment
Answer by MakeCodeNow · Feb 14, 2014 at 02:31 AM
Mark you texture as type GUI or set the Wrap Mode to Clamp. Those border pixels you're seeing are actually appearing because the GPU is automatically reading pixels from the other side of the texture.