本文整理汇总了C#中Loon.Core.Graphics.Opengl.LTexture类的典型用法代码示例。如果您正苦于以下问题:C# LTexture类的具体用法?C# LTexture怎么用?C# LTexture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LTexture类属于Loon.Core.Graphics.Opengl命名空间,在下文中一共展示了LTexture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Logo
public Logo(LTexture texture)
{
this.logo = texture;
this.curTime = 60;
this.curFrame = 0;
this.inToOut = true;
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:7,代码来源:LGameXNA2DActivity.cs
示例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);
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:7,代码来源:LPaper.cs
示例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);
}
}
}
开发者ID:keppelcao,项目名称:LGame,代码行数:34,代码来源:LGradation.cs
示例4: BindBatchCache
public static LTextureBatch BindBatchCache( int index,
LTexture texture) {
if (texture == null) {
return null;
}
int texId = texture.textureID;
return BindBatchCache(index, texId, texture);
}
开发者ID:keppelcao,项目名称:LGame,代码行数:8,代码来源:LTextureBatch.cs
示例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);
}
开发者ID:DONGChuan,项目名称:LGame,代码行数:9,代码来源:LTextureRegion.cs
示例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;
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:9,代码来源:Picture.cs
示例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;
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:9,代码来源:SpriteSheet.cs
示例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;
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:10,代码来源:OutEffect.cs
示例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();
}
}
开发者ID:keppelcao,项目名称:LGame,代码行数:10,代码来源:LGesture.cs
示例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();
}
开发者ID:keppelcao,项目名称:LGame,代码行数:11,代码来源:LControl.cs
示例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;
}
开发者ID:keppelcao,项目名称:LGame,代码行数:12,代码来源:LTransition.cs
示例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();
}
开发者ID:keppelcao,项目名称:LGame,代码行数:52,代码来源:FractionEffect.cs
示例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;
}
}
开发者ID:ordanielcmessias,项目名称:LGame,代码行数:13,代码来源:AVGScreen.cs
示例14: SetBackgroundCG
public void SetBackgroundCG(LTexture backgroundCG)
{
if (backgroundCG == this.background)
{
return;
}
if (background != null)
{
background.Destroy();
background = null;
}
this.background = backgroundCG;
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:13,代码来源:AVGCG.cs
示例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);
}
开发者ID:darragh-murphy,项目名称:LGame,代码行数:18,代码来源:LSelect.cs
示例16: LPad
public LPad(int x, int y, LTexture b, LTexture f, LTexture d, float scale)
: base(x, y, (int)(f.GetWidth() * scale), (int)(f.GetHeight() * scale))
{
this.offsetX = 6 * scale;
this.offsetY = 6 * scale;
this.fore = f;
this.back = b;
this.dot = d;
this.dotWidth = (int)(d.GetWidth() * scale);
this.dotHeight = (int)(d.GetHeight() * scale);
this.baseWidth = (int)(f.GetWidth() * scale);
this.baseHeight = (int)(f.GetHeight() * scale);
this.backWidth = (int)(b.GetWidth() * scale);
this.backHeight = (int)(b.GetHeight() * scale);
this.centerX = (baseWidth - dotWidth) / 2 + offsetX;
this.centerY = (baseHeight - dotHeight) / 2 + offsetY;
this.scale_pad = scale;
}
开发者ID:DONGChuan,项目名称:LGame,代码行数:18,代码来源:LPad.cs
示例17: SplitEffect
public SplitEffect(LTexture t, RectBox limit_0, int d)
{
this.texture = t;
this.width = texture.GetWidth();
this.height = texture.GetHeight();
this.halfWidth = width / 2;
this.halfHeight = height / 2;
this.multiples = 2;
this.direction = d;
this.limit = limit_0;
this.timer = new LTimer(10);
this.visible = true;
this.v1 = new Vector2f();
this.v2 = new Vector2f();
switch (direction)
{
case Config.UP:
case Config.DOWN:
special = true;
{
v1.Set(0, 0);
v2.Set(halfWidth, 0);
break;
}
case Config.TLEFT:
case Config.TRIGHT:
v1.Set(0, 0);
v2.Set(halfWidth, 0);
break;
case Config.LEFT:
case Config.RIGHT:
special = true;
{
v1.Set(0, 0);
v2.Set(0, halfHeight);
break;
}
case Config.TUP:
case Config.TDOWN:
v1.Set(0, 0);
v2.Set(0, halfHeight);
break;
}
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:44,代码来源:SplitEffect.cs
示例18: LoadTex
public static LTexture LoadTex(string name)
{
VaildLoon();
LTexture texture = (LTexture)CollectionUtils.Get(texCaches, name);
if (texture == null || texture.isClose)
{
try
{
LTextureData data = GLLoader.GetTextureData(ResourceManager.GetStream(name));
data.fileName = name;
texture = new LTexture(data);
texture.isExt = true;
}
catch (Exception ex)
{
Loon.Utils.Debugging.Log.Exception(ex);
}
texCaches.Add(name, texture);
}
return texture;
}
开发者ID:keppelcao,项目名称:LGame,代码行数:21,代码来源:XNAConfig.cs
示例19: LoadTexture
public static LTexture LoadTexture(string fileName, Loon.Core.Graphics.Opengl.LTexture.Format format)
{
if (fileName == null)
{
return null;
}
lock (lazyTextures)
{
string key = fileName.Trim().ToLower();
LTexture texture = (LTexture)CollectionUtils.Get(lazyTextures, key);
if (texture != null && !texture.isClose)
{
texture.refCount++;
return texture;
}
texture = new LTexture(fileName, format);
texture.lazyName = fileName;
CollectionUtils.Put(lazyTextures, key, texture);
return texture;
}
}
开发者ID:207h2Flogintvg,项目名称:LGame,代码行数:21,代码来源:LTextures.cs
示例20: SpriteFont
public SpriteFont(LTexture tex2d, List<RectBox> gs,
List<RectBox> crops, List<Char> chars, int line,
float space, List<float[]> kern, char def)
{
this.texture = tex2d;
this.glyphs = gs;
this.cropping = crops;
this.charMap = chars;
this.lineSpacing = 0;
this.spacing = 0f;
this.kerning = kern;
this.defaultchar = def;
Int32 max = 0;
foreach (RectBox rect in glyphs)
{
if (max == null || rect.GetHeight() > max)
{
max = (int)rect.GetHeight();
}
}
this.maxCharY = max;
}
开发者ID:darragh-murphy,项目名称:LGame,代码行数:22,代码来源:SpriteFont.cs
注:本文中的Loon.Core.Graphics.Opengl.LTexture类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论