Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - KittenKoder

Pages: 1 [2] 3 4 5
16
Support / Re: Help with setting image as background and 3d object on top
« on: November 27, 2012, 02:11:49 am »
EgonOlsen, Thanks for the reply!

About NPOT - Could you please point me on how to use NPOT textures feature? I think that's what I was looking for!

About the object - Thanks for the help. I think I got it. One thing I did not fully understand is why when I load the .obj it loads it where it is upside-down. Meaning - I need to rotate it by PI (180 degrees) to see the face of my object. Is this normal? Or i'm doing something wrong?

The point of the application is to put a 3d object onto a photo - then render it to a picture (which I have no idea how to do currently, as I need to render it to the raw image and should not crop it - or not crop it that much) so I'd love for an advice if possible.

Again, thank you for providing this useful information which I will use
Idan

The upside down object is likely because the modeling program you used has a different coordination system. I know Blender is a -Y up for exports to make them load-ready. You aren't doing anything wrong, it's just a nuance between different systems. You could flip the camera to, 180 on the z axis, to accommodate it.

17
Projects / Re: New Library And Game
« on: November 27, 2012, 01:25:29 am »
I knew I was going to forget something important prior to an official version. Well, I forgot the all important loading thread, with callable interface. Plus a more simple animation for the canvas, figured I may as well add it into the library since lots of games us lots of looped animations for things. It's similar to the movie widget, it loads the sequence of images from a jar file then displays them, the difference is that instead of the images being loaded "as needed" to conserve memory at the expense of smoothness, it loads all the frames at once. Other than that the two widgets are almost identical, just lightweight image painters.

18
News / Re: Website relaunched
« on: November 24, 2012, 12:43:51 am »
Looks nice!

And i hope there is a particle system in the jPCT-AE, many games need it ;D

Well, a particle system is actually quite easy, unless you want the physics. I created a very basic one for my library, it fakes physics by having a starting and ending vector for direction and a "mid" point along the life of the particles of where the ending vector is in full control.

19
Projects / Re: Thinking about some RPG..Android version.
« on: November 24, 2012, 12:41:17 am »
Beautiful graphics. I'm so bad with uv mapping I can't even come close to such detail. It's why I stick with the virtual reality or Tron look.

20
Support / Re: Blitting transparency troubles
« on: November 23, 2012, 10:10:51 pm »
Ah yes!

I knew I was being a retard xD

I had them saved as .png images already, I just wasn't loading with the transparency flag turned on.

Now everything works nice and awesomely. :D

Not retarded, you just made a typo from the sound of it. Typos happen, it's the reason we test things. Yes, PNG is a great format for images, in spite of it being a slightly larger file, you can make per pixel translucency, a wonderful format.

21
Projects / Re: New Library And Game
« on: November 23, 2012, 10:06:20 pm »
The texture "melter" I mentioned, in case anyone wants a cool and simple idea for a special effect on models. The class it extends is first, then the actual melter.

Code: [Select]
package kitt.com.jpct.fx;

import kitt.com.jpct.ext.Object3DEx;

/**
 * Like the animator but more useful for special effect type animations that do not loop.
 * There is no management system for these, they are up to the program to manage. This
 * is due to their intended purpose of being simple effects on objects that do not require a
 * lot of updates.
 *
 * @author kitten
 *
 */
abstract public class ModelEffector {
    protected boolean animating = false;
    protected boolean done = false;
   
    /**
     * Should be set to null when finished animating to prevent holding a reference that may need to be removed.
     */
    protected Object3DEx object = null;
   
    /**
     * @return If there is a current animation in effect.
     */
    public boolean isAnimating() {
        return this.animating;
    }
   
    /**
     * This is a state check, once it's checked the state is cleared.
     *
     * @return If finished.
     */
    public boolean isDone() {
        if(this.done) {
            this.done = false;
            return true;
        }
        return false;
    }
   
    /**
     * @return the object
     */
    public Object3DEx getObject() {
        return object;
    }

    /**
     * @param object the object to set
     */
    public void setObject(Object3DEx object) {
        this.object = object;
    }

    /**
     * @param millis Time passed.
     * @return If still animating.
     */
    abstract public boolean tick(int millis);
}

Code: [Select]
package kitt.com.jpct.fx;

import kitt.com.jpct.ext.Object3DEx;

import com.threed.jpct.PolygonManager;

/**
 * Makes the model appear to melt between textures by changing one polygon at a time.
 *
 * @author kitten
 *
 */
public class ModelTextureMelt extends ModelEffector {
    protected int polys = 0;
    protected int textureid = 0;
    protected int index = 0;
    protected float speed = 4.0f;
    protected float step = 0.0f;
    protected PolygonManager manager = null;
   
    /**
     * @param textureid The texture ID to initialize with.
     */
    public ModelTextureMelt(int textureid) {
        this.textureid = textureid;
    }
   
    /**
     * @return the textureid
     */
    public int getTextureID() {
        return textureid;
    }

    /**
     * @param textureid the textureid to set
     */
    public void setTextureID(int textureid) {
        this.textureid = textureid;
    }

    /* (non-Javadoc)
     * @see kitt.com.jpct.fx.ModelEffector#setObject(kitt.com.jpct.ext.Object3DEx)
     */
    @Override
    public void setObject(Object3DEx object) {
        this.object = object;
        if(object != null) {
            this.manager = object.getPolygonManager();
            this.polys = this.manager.getMaxPolygonID();
            this.index = 0;
        }
    }
   
    /**
     * Triggers a repeat of the exact same animation if an object is set.
     */
    public void trigger() {
        if(this.object != null) {
            this.animating = true;
        }
    }
    /* (non-Javadoc)
     * @see kitt.com.jpct.fx.ModelEffector#tick(int)
     */
    @Override
    public boolean tick(int millis) {
        if(this.animating) {
            this.step += ((float)millis / 10.0f) * this.speed;
            while(this.step >= 1.0f && this.animating) {
                this.step -= 1.0f;
                this.manager.setPolygonTexture(this.index, this.textureid);
                this.index++;
                if(this.index >= this.polys) {
                    this.animating = false;
                    this.done = true;
                    this.index = 0;
                }
            }
        }
        return this.animating;
    }

}

22
Projects / Re: New Library And Game
« on: November 23, 2012, 10:04:33 pm »
Nice. Is it still 3D based or more like 2D blits?

Those screencaps are from the CanvasGUI, it's pure Java painting. Though the difference between that and the in game HUD system is minimal. The HUD system, which doesn't have default textures but I could easily write them into it and will be doing so soon, is 2D blitting, and the textures I use are almost identical to the images you see here but using a dynamic texture for printing text or painting onto. I used the regular Swing Canvas for most of the menus because of how light weight it is, but the beauty of it is that the canvas itself can have a backdrop, such as a shot from the GL rendering in some of the earlier screencaps.

It is all animated as well, menus "slide" into and out of view, on both the Canvas and the HUD, by only using a few lines of code, one single animation class, and animation "data" classes. I had to use ArrayLists for animation tracking, which ate up some memory, but there's no telling how many animations will be happening at any given moment so it was a necessary evil. That specific GUI is created with the following code, of course I have added more to it since I made those screencaps:

Code: [Select]
package app;

import java.awt.Color;

import kitt.com.jpct.tex.TextureStored;
import kitt.com.swing.canvas.CanvasButton;
import kitt.com.swing.canvas.CanvasGUI;
import kitt.com.swing.canvas.CanvasLabel;
import kitt.com.swing.canvas.CanvasVideo;
import kitt.com.swing.canvas.CanvasWidget;
import kitt.com.swing.canvas.anim.CanvasAnimationData;
import kitt.com.swing.canvas.data.CanvasImageFont;
import kitt.com.swing.canvas.kits.MenuKit;
import kitt.com.swing.canvas.kits.ToggleMenuKit;
import kitt.com.swing.canvas.kits.WidgetKits;

public class CanvasGUISystem {
    public static final int MODE_CLEAR = 0;
    public static final int MODE_VIDEO = 1;
    public static final int MODE_MAIN = 2;
    public static final int MODE_STATUS = 3;
    public static final int MODE_MODES = 4;
    public static final int MODE_AVATAR = 5;
    public static final int MODE_SYSTEM = 6;
    public static final int MODE_FILES = 6;
   
   
    public static final int STATUS_AVATAR = 0;
    public static final int STATUS_THREADS = 1;
    public static final int STATUS_RAM = 2;
    public static final int STATUS_STORAGE = 3;
    public static final int STATUS_HARDENING = 4;
    public static final int STATUS_SPEED = 5;

    public static final int STATUS_USED_RAM = 6;
    public static final int STATUS_USED_STORAGE = 7;
    public static final int STATUS_USED_HARDENING = 8;
   
    public static final int STATUS_COUNT = 9;
   
    protected CanvasGUI canvas = null;
   
    protected MenuKit mainmenu = null;
    protected CanvasAnimationData mainmenuappear = null;
   
    protected MenuKit statusmenu = null;
    protected CanvasAnimationData statusmenuappear = null;
   
    protected ToggleMenuKit modelist = null;
    protected CanvasAnimationData modelistappear = null;
   
    protected ToggleMenuKit programlist = null;
    protected CanvasAnimationData programlistappear = null;
   
    protected ToggleMenuKit filelist = null;
    protected CanvasAnimationData filelistappear = null;
   
    protected MenuKit filemenu = null;
    protected CanvasAnimationData filemenuappear = null;
   
    protected CanvasWidget statusparent = null;
    protected CanvasLabel[] statusfields = null;
    protected CanvasAnimationData statusappear = null;
   
    protected CanvasLabel logo = null;
    protected CanvasAnimationData logoappear = null;
   
    protected CanvasVideo video = null;
   
    protected TextureStored[] icons = null;
    protected boolean[][] modestates = null;
    protected int currentmode = -1;
   
    protected Color availableprogram = new Color(0,255,255);
    protected Color unavailableprogram = new Color(255,255,0);
    protected Color foreground = new Color(0,255,0);
           
    protected int guimode = 0;
   
    public CanvasGUISystem(CanvasGUI canvas, TextureStored[] icons) {
        this.canvas = canvas;
        this.icons = icons;
       
        CanvasGUI.DEFAULT_DISABLED = new Color(255,0,0,128);
        CanvasGUI.DEFAULT_HOVER = new Color(0,255,0,128);
        CanvasGUI.DEFAULT_PRESSED = new Color(0,0,255,128);
        CanvasGUI.DEFAULT_FOREGROUND = this.foreground;
        CanvasGUI.DEFAULT_BACKGROUND = CanvasGUI.HALFBLACK;

        this.createGUI();
    }
   
    protected void createGUI() {
        this.createLogo();
        this.createMainMenu();
        this.createModeList();
        this.createProgramList();
        this.createStatusMenu();
        this.createStatus();
        this.createFileMenu();
        this.createFileList();
        this.modestates = new boolean[this.modelist.options.length - 1][];
        for(int i = 0; i < this.modestates.length; i++)
            this.modestates[i] = new boolean[this.programlist.options.length];

        CanvasButton button = new CanvasButton(null, "Return\nTo\nGame", 920, 689, 100, 75);
        button.setID("Option-5");
        this.canvas.addWidget(button);

        this.video = new CanvasVideo(null, 50, 50, 924, 668);
        this.video.setFlags(CanvasGUI.IMAGE_STRETCH | CanvasGUI.IMAGE_CENTER);
        this.video.setVisible(false);
        this.canvas.addWidget(this.video);

        this.canvas.sortWidgets();
    }
   
    protected void createLogo() {
        this.logo = new CanvasLabel(null, null, 262, 134, 500, 500);
        this.logo.setFlags(CanvasGUI.SHOWTEXT | CanvasGUI.TEXT_CENTER | CanvasGUI.TEXT_MIDDLE | CanvasGUI.IMAGE_STRETCH);
        this.logo.setZOrder(-1);
        this.logo.setImageFont(new CanvasImageFont(CanvasGUI.IMAGEFONT, 1.5f));
        this.logo.setName("Loading ...");
        for(TextureStored image : this.icons)
            if(image.getName().equals("icon-logo-full"))
                this.logo.setImage(image.getImage());
        this.canvas.addWidget(this.logo);
    }
   
    protected void createMainMenu() {
        CanvasGUI.DEFAULT_FOREGROUND = this.foreground;
        String[][] options = {
                {"Game-Start", "Start"},
                {"Game-Load", "Load"},
                {"Game-Configure", "Settings"},
                {"Game-Delete", "Delete"},
                {"Game-Quit", "Quit"}
            };
        this.mainmenu = WidgetKits.makeMenu(this.canvas, "MainMenu",
                null, 150, 40,
                options, 5, -1);
        this.mainmenu.parent.setLocation(512 - (this.mainmenu.parent.getSize().width / 2), 900);
        this.mainmenu.parent.setVisible(false);
        this.mainmenuappear = CanvasAnimationData.Create(0.0f, -200.0f, 0.05f, true);
    }
   
    protected void createStatusMenu() {
        CanvasGUI.DEFAULT_FOREGROUND = this.foreground;
        String[][] options = {
                {"Status-Play", "Return"},
                {"Status-Avatar", "Avatar"},
                {"Status-Programs", "Programs"},
                {"Status-Files", "Files"},
                {"Status-System", "System"},
                {"Status-Main", "Main Menu"}
            };
        this.statusmenu = WidgetKits.makeMenu(this.canvas, "MainMenu",
                null, 175, 40,
                options, 1, -1);
        this.statusmenu.parent.setLocation(-this.statusmenu.parent.getSize().width, 50);
        this.statusmenu.parent.setVisible(false);
        this.statusmenuappear = CanvasAnimationData.Create(50 + this.statusmenu.parent.getSize().width, 0.0f, 0.05f, true);
    }
   
    protected void createStatus() {
        CanvasGUI.DEFAULT_FOREGROUND = this.availableprogram;
        this.statusparent = new CanvasWidget(null, 100 + this.statusmenu.parent.getSize().width, -500, 500, 500);
        this.statusparent.setFlags(CanvasGUI.BORDER | CanvasGUI.FILL);
        this.statusparent.setBackground(CanvasGUI.HALFBLACK);
        this.statusparent.setForeground(new Color(128,255,128,128));
        this.statusparent.setVisible(false);
        this.canvas.addWidget(this.statusparent);
        this.statusappear = CanvasAnimationData.Create(0.0f, 550.0f, 0.05f, true);
       
        CanvasImageFont font = new CanvasImageFont(CanvasGUI.IMAGEFONT, 1.0f);
       
        CanvasLabel label = new CanvasLabel(this.statusparent, "Avatar:", 10, 10, 230, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_LEFT | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "Threads:", 10, 90, 230, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_LEFT | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "RAM:", 10, 130, 230, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_LEFT | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "/", 340, 130, 20, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_CENTER | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "Storage:", 10, 170, 230, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_LEFT | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "/", 340, 170, 20, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_CENTER | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "Hardening:", 10, 210, 230, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_LEFT | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "/", 340, 210, 20, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_CENTER | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        label = new CanvasLabel(this.statusparent, "Speed:", 10, 250, 230, 40);
        label.setImageFont(font);
        label.setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_LEFT | CanvasGUI.SHOWTEXT);
        this.canvas.addWidget(label);
       
        this.statusfields = new CanvasLabel[CanvasGUISystem.STATUS_COUNT];
        for(int i = 0; i < CanvasGUISystem.STATUS_COUNT; i++) {
            if(i == 0) {
                this.statusfields[i] = new CanvasLabel(this.statusparent, "Shiva", 100, 50, 360, 40);
                this.statusfields[i].setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_RIGHT | CanvasGUI.SHOWTEXT);
            } else if(i < CanvasGUISystem.STATUS_USED_RAM) {
                this.statusfields[i] = new CanvasLabel(this.statusparent, "000", 240, 50 + (i * 40), 100, 40);
                this.statusfields[i].setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_RIGHT | CanvasGUI.SHOWTEXT);
            } else {
                this.statusfields[i] = new CanvasLabel(this.statusparent, "000", 360, 130 + ((i - CanvasGUISystem.STATUS_USED_RAM) * 40), 100, 40);
                this.statusfields[i].setFlags(CanvasGUI.TEXT_MIDDLE | CanvasGUI.TEXT_LEFT | CanvasGUI.SHOWTEXT);
            }
            this.statusfields[i].setImageFont(font);
            this.canvas.addWidget(this.statusfields[i]);
        }
    }

    protected void createProgramList() {
        CanvasGUI.DEFAULT_FOREGROUND = this.availableprogram;
       
        String[][] options = {
                {"Program-0", "Buffer"},
                {"Program-1", "Clone"},
                {"Program-2", "Crash Bomb"},
                {"Program-3", "Decode"},
                {"Program-4", "Deflector"},
                {"Program-5", "Firewall"},
                {"Program-6", "Mask"},
                {"Program-7", "Slicer"},
                {"Program-8", "Spy Bot"},
                {"Program-9", "Torrent"}
            };
        String[] iconname = {
                "icon-buffer",
                "icon-clone",
                "icon-crash-bomb",
                "icon-decode",
                "icon-deflector",
                "icon-firewall",
                "icon-mask",
                "icon-slicer",
                "icon-spy-bot",
                "icon-torrent"
            };
        this.programlist = WidgetKits.makeToggleMenu(this.canvas, "ProgramList",
                null, 200, 40,
                options, 2, CanvasGUI.HEXAGONAL | CanvasGUI.BORDER | CanvasGUI.SHOWTEXT |
                CanvasGUI.TEXT_RIGHT | CanvasGUI.TEXT_MIDDLE | CanvasGUI.FILL  | CanvasGUI.IMAGE_STRETCH);
        this.programlist.parent.setLocation(100 + this.modelist.parent.getSize().width, -this.programlist.parent.getSize().height);
        this.programlist.parent.setVisible(false);
        for (int i = 0; i < this.programlist.options.length; i++) {
            TextureStored icon = null;
            for(int ic = 0; ic < this.icons.length && icon == null; ic++)
                if(this.icons[ic].getName().equals(iconname[i]))
                    icon = this.icons[ic];
            if(icon != null)
                this.programlist.options[i].setImage(icon.getImage());
        }
        this.programlistappear = CanvasAnimationData.Create(0.0f, this.modelist.parent.getY() + this.programlist.parent.getSize().height, 0.05f, true);
    }
   
    protected void createFileList() {
        CanvasGUI.DEFAULT_FOREGROUND = this.availableprogram;
       
        String[][] options = new String[45][];
        for(int i = 0; i < options.length; i++) {
            options[i] = new String[2];
            options[i][0] = "File-" + i;
            options[i][1] = "File (" + (i * 10) + ")";
        }
        this.filelist = WidgetKits.makeToggleMenu(this.canvas, "FileList",
                null, 250, 40,
                options, 3, CanvasGUI.HEXAGONAL | CanvasGUI.BORDER | CanvasGUI.SHOWTEXT |
                CanvasGUI.TEXT_RIGHT | CanvasGUI.TEXT_MIDDLE | CanvasGUI.FILL  | CanvasGUI.IMAGE_STRETCH);
        this.filelist.parent.setLocation(100 + this.filemenu.parent.getSize().width, -this.filelist.parent.getSize().height);
        this.filelist.parent.setVisible(false);
        this.filelist.parent.setSingleToggle(true);
        this.filelistappear = CanvasAnimationData.Create(0.0f, this.filemenu.parent.getY() + this.filelist.parent.getSize().height, 0.05f, true);
    }

    protected void createModeList() {
        CanvasGUI.DEFAULT_FOREGROUND = this.foreground;
       
        String[][] options = {
                {"Mode-0", "Attacker"},
                {"Mode-1", "Defender"},
                {"Mode-2", "Stealth"},
                {"Mode-3", "Interrogator"},
                {"Mode-4", "Ripper"},
                {"Mode-5", "Tank"},
                {"Mode-6", "Worm"},
                {"Mode-7", "Balance"},
                {"Mode-8", "Spy Bot"},
                {"Mode-9", "Back"}
            };
        this.modelist = WidgetKits.makeToggleMenu(this.canvas, "ModeList",
                null, 150, 40,
                options, 1, CanvasGUI.HEXAGONAL | CanvasGUI.BORDER | CanvasGUI.SHOWTEXT |
                CanvasGUI.TEXT_CENTER | CanvasGUI.TEXT_MIDDLE | CanvasGUI.FILL  | CanvasGUI.IMAGE_STRETCH);
        this.modelist.parent.setLocation(-this.modelist.parent.getSize().width, 50);
        this.modelist.parent.setVisible(false);
        this.modelist.parent.setSingleToggle(true);
        this.modelistappear = CanvasAnimationData.Create(50.0f + this.modelist.parent.getSize().width, 0.0f, 0.05f, true);
    }
   
    protected void createFileMenu() {
        CanvasGUI.DEFAULT_FOREGROUND = this.foreground;
       
        String[][] options = {
                {"FileAct-PgUp", "< Page"},
                {"FileAct-PgDn", "Page >"},
                {"FileAct-View", "View"},
                {"FileAct-Delete", "Delete"},
                {"FileAct-Upload", "Upload"},
                {"FileAct-Back", "Back"}
            };
        this.filemenu = WidgetKits.makeMenu(this.canvas, "FileMenu",
                null, 150, 40,
                options, 1, CanvasGUI.HEXAGONAL | CanvasGUI.BORDER | CanvasGUI.SHOWTEXT |
                CanvasGUI.TEXT_CENTER | CanvasGUI.TEXT_MIDDLE | CanvasGUI.FILL  | CanvasGUI.IMAGE_STRETCH);
        this.filemenu.parent.setLocation(-this.filemenu.parent.getSize().width, 50);
        this.filemenu.parent.setVisible(false);
        this.filemenuappear = CanvasAnimationData.Create(50.0f + this.filemenu.parent.getSize().width, 0.0f, 0.05f, true);
    }

    public void mainMenu(String comm) {
        if(comm.equals("Game-Start")) {
            this.changeGUI(CanvasGUISystem.MODE_STATUS);
        } else if(comm.equals("Game-Load")) {
        } else if(comm.equals("Game-Delete")) {
        }       
    }
   
    public void fileMenu(String comm) {
        if(comm.equals("FileAct-View")) {
        } else if(comm.equals("FileAct-PgUp")) {
        } else if(comm.equals("FileAct-PgDn")) {
        } else if(comm.equals("FileAct-Delete")) {
        } else if(comm.equals("FileAct-Upload")) {
        } else if(comm.equals("FileAct-Back")) {
            this.changeGUI(CanvasGUISystem.MODE_STATUS);
            this.filelist.parent.allOffExcept(null);
        }       
    }
   
    public void statusMenu(String comm) {
        if(comm.equals("Status-Avatar")) {
        } else if(comm.equals("Status-Programs")) {
            this.changeGUI(CanvasGUISystem.MODE_MODES);
        } else if(comm.equals("Status-System")) {
//            this.changeGUI(CanvasGUISystem.MODE_SYSTEM);
        } else if(comm.equals("Status-Files")) {
            this.changeGUI(CanvasGUISystem.MODE_FILES);
        } else if(comm.equals("Status-Main")) {
            this.changeGUI(CanvasGUISystem.MODE_MAIN);
        }
    }
   
    public void updateGUI() {
        this.logo.setVisible(
                (this.guimode != CanvasGUISystem.MODE_VIDEO)
            );
        this.video.setVisible(
                (this.guimode == CanvasGUISystem.MODE_VIDEO)
            );
        if(this.guimode== CanvasGUISystem.MODE_CLEAR || this.guimode == CanvasGUISystem.MODE_VIDEO) {
            if(this.modelist.parent.isVisible())
                this.canvas.animate(this.modelist.parent, this.modelistappear, true);
            if(this.programlist.parent.isVisible())
                this.canvas.animate(this.programlist.parent, this.programlistappear, true);
            if(this.mainmenu.parent.isVisible())
                this.canvas.animate(this.mainmenu.parent, this.mainmenuappear, true);
            if(this.statusmenu.parent.isVisible())
                this.canvas.animate(this.statusmenu.parent, this.statusmenuappear, true);
            if(this.statusparent.isVisible())
                this.canvas.animate(this.statusparent, this.statusappear, true);
            if(this.filelist.parent.isVisible())
                this.canvas.animate(this.filelist.parent, this.filelistappear, true);
            if(this.filemenu.parent.isVisible())
                this.canvas.animate(this.filemenu.parent, this.filemenuappear, true);
           
        } else if(this.guimode == CanvasGUISystem.MODE_FILES) {
            if(this.modelist.parent.isVisible())
                this.canvas.animate(this.modelist.parent, this.modelistappear, true);
            if(this.programlist.parent.isVisible())
                this.canvas.animate(this.programlist.parent, this.programlistappear, true);
            if(this.mainmenu.parent.isVisible())
                this.canvas.animate(this.mainmenu.parent, this.mainmenuappear, true);
            if(this.statusmenu.parent.isVisible())
                this.canvas.animate(this.statusmenu.parent, this.statusmenuappear, true);
            if(this.statusparent.isVisible())
                this.canvas.animate(this.statusparent, this.statusappear, true);
           
            if(!this.filelist.parent.isVisible())
                this.canvas.animate(this.filelist.parent, this.filelistappear, false);
            if(!this.filemenu.parent.isVisible())
                this.canvas.animate(this.filemenu.parent, this.filemenuappear, false);

        } else if(this.guimode == CanvasGUISystem.MODE_SYSTEM) {
            if(this.modelist.parent.isVisible())
                this.canvas.animate(this.modelist.parent, this.modelistappear, true);
            if(this.programlist.parent.isVisible())
                this.canvas.animate(this.programlist.parent, this.programlistappear, true);
            if(this.statusmenu.parent.isVisible())
                this.canvas.animate(this.statusmenu.parent, this.statusmenuappear, true);
            if(this.mainmenu.parent.isVisible())
                this.canvas.animate(this.mainmenu.parent, this.mainmenuappear, true);
            if(this.statusparent.isVisible())
                this.canvas.animate(this.statusparent, this.statusappear, true);
            if(this.filelist.parent.isVisible())
                this.canvas.animate(this.filelist.parent, this.filelistappear, true);
            if(this.filemenu.parent.isVisible())
                this.canvas.animate(this.filemenu.parent, this.filemenuappear, true);
           
        } else if(this.guimode == CanvasGUISystem.MODE_MAIN) {
            if(this.modelist.parent.isVisible())
                this.canvas.animate(this.modelist.parent, this.modelistappear, true);
            if(this.programlist.parent.isVisible())
                this.canvas.animate(this.programlist.parent, this.programlistappear, true);
            if(this.statusmenu.parent.isVisible())
                this.canvas.animate(this.statusmenu.parent, this.statusmenuappear, true);
            if(this.statusparent.isVisible())
                this.canvas.animate(this.statusparent, this.statusappear, true);
            if(this.filelist.parent.isVisible())
                this.canvas.animate(this.filelist.parent, this.filelistappear, true);
            if(this.filemenu.parent.isVisible())
                this.canvas.animate(this.filemenu.parent, this.filemenuappear, true);

            if(!this.mainmenu.parent.isVisible())
                this.canvas.animate(this.mainmenu.parent, this.mainmenuappear, false);
           
        } else if(this.guimode == CanvasGUISystem.MODE_STATUS) {
            if(this.modelist.parent.isVisible())
                this.canvas.animate(this.modelist.parent, this.modelistappear, true);
            if(this.programlist.parent.isVisible())
                this.canvas.animate(this.programlist.parent, this.programlistappear, true);
            if(this.mainmenu.parent.isVisible())
                this.canvas.animate(this.mainmenu.parent, this.mainmenuappear, true);
            if(this.filelist.parent.isVisible())
                this.canvas.animate(this.filelist.parent, this.filelistappear, true);
            if(this.filemenu.parent.isVisible())
                this.canvas.animate(this.filemenu.parent, this.filemenuappear, true);
           
            if(!this.statusmenu.parent.isVisible())
                this.canvas.animate(this.statusmenu.parent, this.statusmenuappear, false);
            if(!this.statusparent.isVisible())
                this.canvas.animate(this.statusparent, this.statusappear, false);
           
        } else if(this.guimode == CanvasGUISystem.MODE_AVATAR) {
            if(this.modelist.parent.isVisible())
                this.canvas.animate(this.modelist.parent, this.modelistappear, true);
            if(this.programlist.parent.isVisible())
                this.canvas.animate(this.programlist.parent, this.programlistappear, true);
            if(this.mainmenu.parent.isVisible())
                this.canvas.animate(this.mainmenu.parent, this.mainmenuappear, true);
            if(this.statusmenu.parent.isVisible())
                this.canvas.animate(this.statusmenu.parent, this.statusmenuappear, true);
            if(this.statusparent.isVisible())
                this.canvas.animate(this.statusparent, this.statusappear, true);
            if(this.filelist.parent.isVisible())
                this.canvas.animate(this.filelist.parent, this.filelistappear, true);
            if(this.filemenu.parent.isVisible())
                this.canvas.animate(this.filemenu.parent, this.filemenuappear, true);
           
        } else if(this.guimode == CanvasGUISystem.MODE_MODES) {
            if(!this.modelist.parent.isVisible())
                this.canvas.animate(this.modelist.parent, this.modelistappear, false);
            if(!this.programlist.parent.isVisible())
                this.canvas.animate(this.programlist.parent, this.programlistappear, false);
           
            if(this.filelist.parent.isVisible())
                this.canvas.animate(this.filelist.parent, this.filelistappear, true);
            if(this.filemenu.parent.isVisible())
                this.canvas.animate(this.filemenu.parent, this.filemenuappear, true);
            if(this.mainmenu.parent.isVisible())
                this.canvas.animate(this.mainmenu.parent, this.mainmenuappear, true);
            if(this.statusmenu.parent.isVisible())
                this.canvas.animate(this.statusmenu.parent, this.statusmenuappear, true);
            if(this.statusparent.isVisible())
                this.canvas.animate(this.statusparent, this.statusappear, true);
        }
    }
   
    public void changeGUI(int mode) {
        this.guimode = mode;
        this.updateGUI();
    }
   
    public void setLogo(String label) {
        this.logo.setName(label);
    }
   
    public void synchModeList(HUDSystem hud) {
        for(int i = 0; i < this.modelist.options.length; i++) {
            hud.setModeLabel("ModeSet-" + i, this.modelist.options[i].getName());
        }
    }
   
    public boolean[][] getModeStates() {
        return this.modestates;
    }
   
    public void setMode() {
        int modeindex = -1;
        for(int i = 0; i < this.modelist.options.length && modeindex == -1; i++)
            if(this.modelist.options[i].isToggled())
                modeindex = i;
        this.currentmode = modeindex;
        if(modeindex != -1) {
            if(modeindex == 9) {
                this.modelist.options[9].setToggled(false);
                this.changeGUI(CanvasGUISystem.MODE_STATUS);
            } else
                for(int i = 0; i < this.programlist.options.length; i++)
                    this.programlist.options[i].setToggled(this.modestates[modeindex][i]);
        }
    }
   
    public void setProgram(String name) {
        if(this.currentmode != -1) {
            int progindex = -1;
            for(int i = 0; i < this.programlist.options.length && progindex == -1; i++)
                if(this.programlist.options[i].getID().equals(name))
                    progindex = i;
            if(progindex != -1) {
                this.modestates[this.currentmode][progindex] = this.programlist.options[progindex].isToggled();
            }
        }
    }
   
    public void playMovie(String movie) {
        this.video.playMovie(movie);
        this.changeGUI(CanvasGUISystem.MODE_VIDEO);
    }
    public boolean isMovieDone() {
        return this.video.isDone();
    }
    public void endMovie() {
        if(this.video.isPlaying()) {
            this.video.endPlaying();
            this.changeGUI(CanvasGUISystem.MODE_STATUS);
        }
    }
    public void setMoviePause(boolean pause) {
        this.video.setPause(pause);
    }
}

Also, if you sign up for the wiki I have, I'll make you a contributor immediately since my game library depends a lot on jPCT.

I also figured out how to add texture "melting" to objects using the polygon manager. It's a pretty nifty effect, considering working on more such effects. It switches to a texture one polygon at a time based on the time passage, I'll post that class after I submit this.

23
Support / Re: Blitting transparency troubles
« on: November 23, 2012, 05:27:35 pm »
The transparency key values have a variance due to JPEG inaccuracies, try using pngs if you want perfect. ;)

24
Projects / Re: New Library And Game
« on: November 23, 2012, 07:24:31 am »
Check these out, other than one tiny mistake I just corrected, these are actual GUI's created by my CanvasGUI system using only a few images. The hex in the background is an image widget, the green symbols in the the second one are all icon images, the rest is pure code, and only one way to make the widgets look.



25
Projects / Re: New Library And Game
« on: November 23, 2012, 12:46:11 am »
I know the wiki should be made after I actually test the library completely, but meh, the wiki is not just for this library anyway. Figure I may as well start making all my libraries available, under open source licensing, though really I'll just enforce a cc-By, since I prefer that license over all others. I call it honor-ware.  :P Basically, this is me taking my skill seriously finally, after so long.

Right now I am parking it on my other site, once I get some stuff added based on input from people who use the library, I'll purchase a new domain name for it.

http://digitalnoisegraffiti.com/wiki/

26
Support / Re: Not jPCT Related
« on: November 22, 2012, 03:18:34 am »
Alright, quick technical question about the loaders for jPCT, do they use input streams from the filenames when you supply them? Such as Texture(java.lang.String filename), so if supplied a URL, fully qualified path including the proper jar path formatting, would it it error out?

I have no way to test jarred applets right now, the OS I use, FireFox, and Java seem to be having issues. I should switch browsers but I really like FireFox.

27
Projects / Re: New Library And Game
« on: November 22, 2012, 12:54:10 am »
Alright, I have added a movie player to the canvas GUI system, It's lightweight but effective. It operates by playing a sequence of images from a jar. Pretty simple really.

28
Support / Re: Noobest Question Ever?
« on: November 21, 2012, 10:13:15 pm »
If the weapon is only used for the same model, or all the animations for the models using it are the same, you could just animate the model and then parent it, matching the animation of the parent to the weapon. That's the old school method, and it tends to work in most situations. However, if that won't work then you'll have to actually find out where to position the weapon a complex way.

The complex method is to locate the polygon of the model you want the weapon to follow, then using the polygon manager of the object update the weapon to match that polygon's position from the rest of the model, and move the weapon to match. The problem with this method is you have to know the index of the polygon you are going to follow.

If you are using skeletal animations I believe there is a much easier method, but I have no experience with such.

29
Support / Re: Primary Flight Display HUD
« on: November 21, 2012, 09:42:56 pm »
For the gradient texture you could make a small 32x32 BufferedImage and paint a gradient onto that using Graphics2D, then turn it into a texture pretty easily.

I forgot to check which platform again. I don't know if AE has the same ability as pure Java for the gradient painting, but it's a starting point.

30
Support / Re: Not jPCT Related
« on: November 21, 2012, 09:02:53 pm »
I'm usually doing it this way, i.e trying to load it from the jar and it that fails, i'm trying to access it as a file. I somehow dislike the URL approach and prefer InputStreams.

The more I look into it, your method may work best. It's been so long since I've tried to develop something for other programmers that I had forgotten all the tricks to making things work in multiple ways. I am wondering if new File would break in applets, if not, since the resources for the system I'm writing all use the built in IO methods, then I'm just going to leave it up to the coder to handle. I have a jar resource formatter to create a jar URL and a doc-base extractor for working from within jars that works with applets as well.

Pages: 1 [2] 3 4 5