本文整理汇总了C#中Loon.Core.Graphics.Opengl.LTexture类的典型用法代码示例。如果您正苦于以下问题:C# LTexture类的具体用法?C# LTexture怎么用?C# LTexture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LTexture类属于Loon.Core.Graphics.Opengl命名空间,在下文中一共展示了LTexture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Logo
public Logo(LTexture texture)
{
this.logo = texture;
this.curTime = 60;
this.curFrame = 0;
this.inToOut = true;
}
示例2: LPaper
public LPaper(LTexture background, int x, int y):base(x, y, background.GetWidth(), background.GetHeight()) {
this.customRendering = true;
this.SetBackground(background);
this.SetElastic(true);
this.SetLocked(true);
this.SetLayer(100);
}
示例3: DrawWidth
public void DrawWidth(GLEx g, int x, int y) {
try {
if (drawTexWidth == null) {
LImage img = LImage.CreateImage(width, height, true);
LGraphics gl = img.GetLGraphics();
for (int i = 0; i < width; i++) {
gl.SetColor(
(start.GetRed() * (width - i)) / width
+ (end.GetRed() * i) / width,
(start.GetGreen() * (width - i)) / width
+ (end.GetGreen() * i) / width,
(start.GetBlue() * (width - i)) / width
+ (end.GetBlue() * i) / width, alpha);
gl.DrawLine(i, 0, i, height);
}
drawTexWidth = new LTexture(GLLoader.GetTextureData(img),
Loon.Core.Graphics.Opengl.LTexture.Format.SPEED);
gl.Dispose();
gl = null;
}
g.DrawTexture(drawTexWidth, x, y);
} catch (Exception) {
for (int i = 0; i < width; i++) {
g.SetColorValue(
(start.GetRed() * (width - i)) / width
+ (end.GetRed() * i) / width,
(start.GetGreen() * (width - i)) / width
+ (end.GetGreen() * i) / width,
(start.GetBlue() * (width - i)) / width
+ (end.GetBlue() * i) / width, alpha);
g.DrawLine(i + x, y, i + x, y + height);
}
}
}
示例4: BindBatchCache
public static LTextureBatch BindBatchCache( int index,
LTexture texture) {
if (texture == null) {
return null;
}
int texId = texture.textureID;
return BindBatchCache(index, texId, texture);
}
示例5: LTextureRegion
public LTextureRegion(LTexture texture, int x, int y, int width, int height)
{
if (texture == null)
{
throw new Exception("texture cannot be null.");
}
this.texture = texture;
SetRegion(x, y, width, height);
}
示例6: Picture
public Picture(LTexture image, int x, int y) {
if (image != null) {
this.SetImage(image);
this.width = image.GetWidth();
this.height = image.GetHeight();
}
this.SetLocation(x, y);
this.visible = true;
}
示例7: 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;
}
示例8: 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;
}
示例9: CreateUI
public override void CreateUI(GLEx g, int x, int y, LComponent component,
LTexture[] buttonImage) {
if (visible && goalPath != null) {
g.SetLineWidth(lineWidth);
g.SetColor(color);
g.Draw(goalPath);
g.ResetLineWidth();
g.ResetColor();
}
}
示例10: LControl
public LControl(int x, int y, LTexture basefile, LTexture dot, int bw,
int bh, int dw, int dh):base(x, y, bw, bh) {
this.controlBase = basefile;
this.controlDot = dot;
this.baseWidth = bw;
this.baseHeight = bh;
this.dotWidth = dw;
this.dotHeight = dh;
this.allowDiagonal = true;
this.CenterOffset();
}
示例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: Init
private void Init(LTexture tex2d, float limit, bool remove, float scale) {
this.isVisible = true;
this.expandLimit = limit;
this.width = tex2d.GetWidth();
this.height = tex2d.GetHeight();
this.scaleWidth = (int) (width * scale);
this.scaleHeight = (int) (height * scale);
this.loopMaxCount = (MathUtils.Max(scaleWidth, scaleHeight) / 2) + 1;
this.fractions = new float[(scaleWidth * scaleHeight) * maxElements];
this.exWidth = (int) (scaleWidth * expandLimit);
this.exHeigth = (int) (scaleHeight * expandLimit);
LImage image = tex2d.GetImage().ScaledInstance(scaleWidth, scaleHeight);
Color[] pixels = image.GetPixels();
if (image != null) {
image.Dispose();
image = null;
}
this.size = pixels.Length;
this.pixmap = new LPixmapData(exWidth, exHeigth, true);
int no = 0, idx = 0;
int length = fractions.Length;
float angle = 0;
float speed = 0;
System.Random random = LSystem.random;
for (int y = 0; y < scaleHeight; y++) {
for (int x = 0; x < scaleWidth; x++) {
if (idx + maxElements < length) {
no = y * scaleWidth + x;
angle = random.Next(360);
speed = 10f / random.Next(30);
fractions[idx + 0] = x;
fractions[idx + 1] = y;
fractions[idx + 2] = (MathUtils.Cos(angle * MathUtils.PI
/ 180) * speed);
fractions[idx + 3] = (MathUtils.Sin(angle * MathUtils.PI
/ 180) * speed);
fractions[idx + 4] = (pixels[no].PackedValue == 0xff00 ? 0xffffff
: pixels[no].PackedValue);
fractions[idx + 5] = x / 6 + random.Next(10);
idx += maxElements;
}
}
}
if (remove) {
if (tex2d != null) {
tex2d.Destroy();
tex2d = null;
}
}
this.tmp = tex2d;
this.StartUsePixelThread();
}
示例13: AVGScreen
public AVGScreen(string initscript, LTexture img)
{
if (initscript == null)
{
return;
}
this.scriptName = initscript;
if (img != null)
{
this.dialogFileName = img.GetFileName();
this.dialog = img;
}
}
示例14: SetBackgroundCG
public void SetBackgroundCG(LTexture backgroundCG)
{
if (backgroundCG == this.background)
{
return;
}
if (background != null)
{
background.Destroy();
background = null;
}
this.background = backgroundCG;
}
示例15: LSelect
public LSelect(LTexture formImage, int x, int y, int width, int height):base(x, y, width, height) {
if (formImage == null) {
this.SetBackground(new LTexture(width, height, true, Loon.Core.Graphics.Opengl.LTexture.Format.SPEED));
this.SetAlpha(0.3F);
} else {
this.SetBackground(formImage);
}
this.customRendering = true;
this.selectFlag = 1;
this.tmpOffset = -(width / 10);
this.delay = new LTimer(150);
this.autoAlpha = 0.25F;
this.isAutoAlpha = true;
this.SetCursor(XNAConfig.LoadTex(LSystem.FRAMEWORK_IMG_NAME + "creese.png"));
this.SetElastic(true);
this.SetLocked(true);
this.SetLayer(100);
}