Android Open Source - smoke-or-fire Btn






From Project

Back to project page smoke-or-fire.

License

The source code is released under:

GNU General Public License

If you think the Android project smoke-or-fire listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 *  Copyright 2012 Brian Flores//from w  w w .jav  a2  s  .c  om
 *
 *  This file is part of SmokeOrFire.
 *
 *  SmokeOrFire is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  SmokeOrFire is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with SmokeOrFire.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.votebrian.games.sof;

import android.content.Context;

import javax.microedition.khronos.opengles.GL10;

public class Btn extends Model {
    private Global gbl;
    private float mRotOffset = 0;
    private float mXOffset;
    private float mYOffset;
    private float mZOffset;
    private float[] mRotAxes = {0f, 0f, 0f};

    public Btn(Context context, GL10 gl) {
        super(context, gl);

        gbl = (Global) context.getApplicationContext();
    }

    public void draw(GL10 gl) {
        gl.glPushMatrix();
        gl.glTranslatef(mXOffset, mYOffset, mZOffset);
        gl.glRotatef(mRotOffset, mRotAxes[0], mRotAxes[1], mRotAxes[2]);
        gl.glTranslatef(-mXOffset, -mYOffset, -mZOffset);
        super.draw(gl);
        gl.glPopMatrix();
    }

    public void setOffsets(float x, float y, float z) {
        mXOffset = x;
        mYOffset = y;
        mZOffset = z;
    }

    public void setRotAxes(float[] axes){
        mRotAxes = axes;
    }

    public void setRotOffset(float offset){
        mRotOffset = offset;
    }
}




Java Source Code List

net.votebrian.games.sof.AboutActivity.java
net.votebrian.games.sof.Base64DecoderException.java
net.votebrian.games.sof.Base64.java
net.votebrian.games.sof.Btn.java
net.votebrian.games.sof.Buttons.java
net.votebrian.games.sof.Card.java
net.votebrian.games.sof.Deck.java
net.votebrian.games.sof.GLESRenderer.java
net.votebrian.games.sof.Global.java
net.votebrian.games.sof.IabException.java
net.votebrian.games.sof.IabHelper.java
net.votebrian.games.sof.IabResult.java
net.votebrian.games.sof.Inventory.java
net.votebrian.games.sof.Labels.java
net.votebrian.games.sof.Model.java
net.votebrian.games.sof.PassButton.java
net.votebrian.games.sof.PurchaseActivity.java
net.votebrian.games.sof.Purchase.java
net.votebrian.games.sof.Security.java
net.votebrian.games.sof.SkuDetails.java
net.votebrian.games.sof.SoFActivity.java
net.votebrian.games.sof.SurfaceView.java
net.votebrian.games.sof.TutorialActivity.java