本文整理汇总了C#中Loon.Core.Graphics.OpenGL.LTexture类的典型用法代码示例。如果您正苦于以下问题:C# LTexture类的具体用法?C# LTexture怎么用?C# LTexture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LTexture类属于Loon.Core.Graphics.OpenGL命名空间,在下文中一共展示了LTexture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmulatorButton
public EmulatorButton(LTexture img, int w, int h, int x, int y,
bool flag, int sizew, int sizeh)
{
this.color = new LColor(LColor.gray.R, LColor.gray.G,
LColor.gray.B, 125);
img.LoadTexture();
if (flag)
{
this.bitmap = img.GetSubTexture(x, y, w, h);
}
else
{
this.bitmap = img;
}
if (bitmap.GetWidth() != sizew || bitmap.GetHeight() != sizeh)
{
LTexture tmp = bitmap;
this.bitmap = bitmap.Scale(sizew, sizeh);
if (tmp != null)
{
tmp.Dispose();
tmp = null;
}
}
this.bounds = new RectBox(0, 0, bitmap.GetWidth(), bitmap.GetHeight());
}
示例2: CreateShadowTexture
public static LTexture CreateShadowTexture(LTexture texture, float alpha,
float scale, float angle)
{
int width = texture.Width;
int height = texture.Height;
LPixmap image = new LPixmap(texture);
int centerX = width / 2;
int centerY = height / 2;
int offsetX = (int)((width - image.Width) / 2);
int offsetY = (int)((height - image.Height) / 2);
Loon.Core.Geom.Matrix.Transform2i t = new Loon.Core.Geom.Matrix.Transform2i();
t.Rotate(angle, centerX, centerY);
t.Zoom(scale, centerX, centerY);
LPixmap shadowProcess = new LPixmap(width, height,
image.IsAlpha());
shadowProcess.DrawPixmap(image, offsetX, offsetY);
shadowProcess.Transparency();
shadowProcess.Mul(255, 0, 0, 0);
shadowProcess.Mul((int)(alpha * 255), 255, 255, 255);
shadowProcess.Convolve(LPixmap.GaussianBlurKernel());
shadowProcess.Transform(t);
if (image != null)
{
image.Dispose();
image = null;
}
return shadowProcess.Texture;
}
示例3: LMessage
public LMessage(LTexture formImage, int x, int y, int width, int height)
: base(x, y, width, height)
{
this.animation = new Animation();
if (formImage == null)
{
this.SetBackground(new LTexture(width, height, true));
this.SetAlpha(0.3F);
}
else
{
this.SetBackground(formImage);
if (width == -1)
{
width = formImage.GetWidth();
}
if (height == -1)
{
height = formImage.GetHeight();
}
}
this.print = new Print(GetLocation(), messageFont, width, height);
if (XNAConfig.IsActive())
{
this.SetTipIcon(XNAConfig.LoadTex(LSystem.FRAMEWORK_IMG_NAME + "creese.png"));
}
this.totalDuration = 80;
this.customRendering = true;
this.SetWait(false);
this.SetElastic(true);
this.SetLocked(true);
this.SetLayer(100);
}
示例4: LInfo
public LInfo(LTexture formImage, int x, int y, int width, int height)
: base(x, y, width, height)
{
fontSize = deffont.GetSize();
if (formImage == null)
{
this.SetBackground(new LTexture(width, height, true));
this.SetAlpha(0.3F);
}
else
{
this.SetBackground(formImage);
if (width == -1)
{
width = formImage.GetWidth();
}
if (height == -1)
{
height = formImage.GetHeight();
}
}
this.message_char_count = 0;
this.message_x = new int[messageCountMax];
this.message_y = new int[messageCountMax];
this.locatePoint = new List<LocatePoint>();
this.flag = new FlagImage(this);
this.customRendering = true;
this.SetElastic(true);
this.SetLayer(100);
}
示例5: OutEffect
public OutEffect(LTexture t, RectBox limit, int code)
{
this.texture = t;
this.type = code;
this.width = t.Width;
this.height = t.Height;
this.multiples = 1;
this.limit = limit;
this.visible = true;
}
示例6: SpriteSheet
public SpriteSheet(LTexture img, int tw, int th, int s, int m)
{
this.width = img.GetWidth();
this.height = img.GetHeight();
this.target = img;
this.tw = tw;
this.th = th;
this.margin = m;
this.spacing = s;
}
示例7: ScrollEffect
public ScrollEffect(int d, LTexture tex2d, float x, float y, int w, int h)
{
this.SetLocation(x, y);
this.texture = tex2d;
this.width = w;
this.height = h;
this.count = 1;
this.timer = new LTimer(10);
this.visible = true;
this.code = d;
}
示例8: LTextureRegion
public LTextureRegion(LTexture texture, int x, int y, int width, int height)
{
if (texture == null)
{
throw new ArgumentException("texture cannot be null.");
}
this.texture = texture;
this.widthRatio = 1f;
this.heightRatio = 1f;
SetRegion(x, y, width, height);
}
示例9: Dispose
public static void Dispose(LTexture[] images)
{
if (images == null)
{
return;
}
for (int i = 0; i < images.Length; i++)
{
images[i].Dispose();
images[i] = null;
}
}
示例10: Picture
public Picture(LTexture i, int x, int y)
{
this.alpha = 1f;
if (i != null)
{
this.SetImage(i);
this.width = i.GetWidth();
this.height = i.GetHeight();
}
this.SetLocation(x, y);
this.visible = true;
}
示例11: NewCross
public static LTransition NewCross(int c, LTexture texture)
{
if (GLEx.Self != null)
{
LTransition transition = new LTransition();
transition.SetTransitionListener(new _Cross(c, texture));
transition.SetDisplayGameUI(true);
transition.code = 1;
return transition;
}
return null;
}
示例12: SpriteRegion
public SpriteRegion(LTexture texture, int srcX, int srcY, int srcWidth,
int srcHeight)
{
if (texture == null)
{
throw new ArgumentException("texture cannot be null.");
}
this.texture = texture;
SetRegion(srcX, srcY, srcWidth, srcHeight);
SetColor(1f, 1f, 1f, 1f);
SetSize(Math.Abs(srcWidth), Math.Abs(srcHeight));
SetOrigin(width / 2, height / 2);
}
示例13: Dispose
public void Dispose()
{
if (texture != null)
{
texture.Destroy();
texture = null;
}
}
示例14: Dispose
public virtual void Dispose()
{
if (sakura != null)
{
sakura.Destroy();
sakura = null;
}
}
示例15: Dispose
public virtual void Dispose()
{
if (image != null)
{
image.Dispose();
image = null;
}
}