言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Texture2D.Texture2D

public function Texture2D(width: int, height: int)

Description

新規の空のテクスチャを作成します

テクスチャは、サイズは width × height となり、ARGB32 TextureFormat (テクスチャ形式)、ミップマップつきおよび sRGB カラー空間です。 通常は作成した後、テクスチャの色を設定したいと思うでしょう。 SetPixel、SetPixels、Applyの関数を使用して

	function Start () {
		// Create a new texture and assign it to the renderer's material
		var texture = new Texture2D (128, 128);
		renderer.material.mainTexture = texture;
	}

See Also: SetPixel, SetPixels, Apply 関数

public function Texture2D(width: int, height: int, format: TextureFormat, mipmap: bool)

Description

新規の空のテクスチャを作成します

テクスチャはwidth(幅)・height(高さ)、与えられたフォーマット、 ミップマップの有無にかかわらず、直線またはsRGB色空間のいずれかで構成されます。 通常は作成した後、テクスチャの色を設定したいと思うでしょう。 SetPixel、SetPixels、Applyの関数を使用して

	function Start () {
		// Create a new texture and assign it to the renderer's material
		var texture = new Texture2D(128, 128, TextureFormat.ARGB32, false);
		renderer.material.mainTexture = texture;
	}

See Also: SetPixel, SetPixels, Apply 関数

public function Texture2D(width: int, height: int, format: TextureFormat, mipmap: bool, linear: bool)

Description

See Also: SetPixel, SetPixels, Apply 関数