当前位置: 首页>>代码示例>>Java>>正文


Java Texture.bind方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.Texture.bind方法的典型用法代码示例。如果您正苦于以下问题:Java Texture.bind方法的具体用法?Java Texture.bind怎么用?Java Texture.bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.Texture的用法示例。


在下文中一共展示了Texture.bind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: progress

import com.badlogic.gdx.graphics.Texture; //导入方法依赖的package包/类
public void progress(float cx, float cy, float r, float thickness, float amt, Color c, Texture lookup) {
    //start and end angles
    float start = 0f;
    float end = amt * 360f;

    lookup.bind();
    renderer.begin(cam.combined, GL20.GL_TRIANGLE_STRIP);
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    int segs = (int)(24 * Math.cbrt(r));
    end += 90f;
    start += 90f;
    float halfThick = thickness/2f;
    float step = 360f / segs;
    for (float angle=start; angle<(end+step); angle+=step) {
        float tc = 0.5f;
        if (angle==start)
            tc = 0f;
        else if (angle>=end)
            tc = 1f;

        float fx = MathUtils.cosDeg(angle);
        float fy = MathUtils.sinDeg(angle);

        float z = 0f;
        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 1f);
        renderer.vertex(cx + fx * (r + halfThick), cy + fy * (r + halfThick), z);

        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 0f);
        renderer.vertex(cx + fx * (r + -halfThick), cy + fy * (r + -halfThick), z);
    }
    renderer.end();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:36,代码来源:ScreenExtensions.java

示例2: progress

import com.badlogic.gdx.graphics.Texture; //导入方法依赖的package包/类
public void progress(float cx, float cy, float r, float thickness, float amt, Color c, Texture lookup) {
    //start and end angles
    float start = 0f;
    float end = amt * 360f;

    lookup.bind();
    renderer.begin(cam.combined, GL20.GL_TRIANGLE_STRIP);
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
    int segs = (int)(24 * Math.cbrt(r));
    end += 90f;
    start += 90f;
    float halfThick = thickness/2f;
    float step = 360f / segs;
    for (float angle=start; angle<(end+step); angle+=step) {
        float tc = 0.5f;
        if (angle==start)
            tc = 0f;
        else if (angle>=end)
            tc = 1f;

        float fx = MathUtils.cosDeg(angle);
        float fy = MathUtils.sinDeg(angle);

        float z = 0f;
        //renderer.
        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 1f);
        renderer.vertex(cx + fx * (r + halfThick), cy + fy * (r + halfThick), z);

        renderer.color(c.r, c.g, c.b, c.a);
        renderer.texCoord(tc, 0f);
        renderer.vertex(cx + fx * (r + -halfThick), cy + fy * (r + -halfThick), z);
    }
    renderer.end();
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:37,代码来源:ScreenRooms.java

示例3: setTextureAnisotropy

import com.badlogic.gdx.graphics.Texture; //导入方法依赖的package包/类
/**
 * Applies the given anisotropic level to the texture. Returns the anisotropy value that was applied,
 * based on device's maximum capability. Note that this call binds the texture.
 *
 * @param texture    The texture to apply anisotropy to.
 * @param anisotropy The anisotropic level to apply. (Will be reduced if device capability is less.
 * @return The anisotropic level that was applied, or -1.0 if anisotropy is not supported by the device.
 */
public static float setTextureAnisotropy (Texture texture, float anisotropy) {
    if (!checkComplete)
        isSupported();
    if (anisotropySupported) {
        texture.bind();
        float valueApplied = Math.min(maxAnisotropySupported, anisotropy);
        Gdx.gl20.glTexParameterf(GL20.GL_TEXTURE_2D, GL20.GL_TEXTURE_MAX_ANISOTROPY_EXT, valueApplied);
        return valueApplied;
    } else {
        return -1f;
    }
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:21,代码来源:Anisotropy.java


注:本文中的com.badlogic.gdx.graphics.Texture.bind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。