Package com.ardor3d.extension.ui.util

Examples of com.ardor3d.extension.ui.util.SubTex


        // value label
        {
            final UIBorder labelBorder = new ImageBorder(
            // left
                    new SubTex(_sharedTex, 155, 11, 4, 10),
                    // right
                    new SubTex(_sharedTex, 185, 11, 4, 10),
                    // top
                    new SubTex(_sharedTex, 159, 7, 16, 4),
                    // bottom
                    new SubTex(_sharedTex, 159, 21, 16, 4),
                    // top left
                    new SubTex(_sharedTex, 155, 7, 4, 4),
                    // top right
                    new SubTex(_sharedTex, 177, 7, 1, 4),
                    // bottom left
                    new SubTex(_sharedTex, 155, 21, 4, 4),
                    // bottom right
                    new SubTex(_sharedTex, 177, 21, 1, 4));

            final UILabel label = component.getValueLabel();
            label.setBackdrop(upBack);
            label.setBorder(labelBorder);
            label.setAlignment(Alignment.LEFT);
            label.setPadding(new Insets(0, 2, 0, 2));
        }

        // drop down button
        {
            final UIBorder buttonBorder = new ImageBorder(
            // left
                    new SubTex(_sharedTex, 177, 11, 1, 10),
                    // right
                    new SubTex(_sharedTex, 185, 11, 4, 10),
                    // top
                    new SubTex(_sharedTex, 178, 7, 7, 4),
                    // bottom
                    new SubTex(_sharedTex, 178, 21, 7, 4),
                    // top left
                    new SubTex(_sharedTex, 177, 7, 1, 4),
                    // top right
                    new SubTex(_sharedTex, 185, 7, 4, 4),
                    // bottom left
                    new SubTex(_sharedTex, 177, 21, 1, 4),
                    // bottom right
                    new SubTex(_sharedTex, 185, 21, 4, 4));

            final UIButton button = component.getOpenButton();
            button.setButtonText("");
            button.setButtonIcon(new SubTex(_sharedTex, 196, 12, 10, 9));
            button.getMouseOverState().setIcon(new SubTex(_sharedTex, 210, 12, 10, 9));
            button.setBorder(buttonBorder);
            button.setBackdrop(upBack);
            button.setMargin(new Insets(0, 0, 0, 0));
            button.setPadding(new Insets(0, 1, 0, 1));
            for (final UIState state : button.getStates()) {
View Full Code Here


                state.setBorder(null);
                state.setBackdrop(null);
            }
            button.setButtonText("");
            if (component.getOrientation() == Orientation.Horizontal) {
                button.setButtonIcon(new SubTex(_sharedTex, 130, 121, 16, 15));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 130, 137, 16, 15));
            } else {
                button.setButtonIcon(new SubTex(_sharedTex, 97, 120, 15, 16));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 113, 120, 15, 16));
            }
        }
        {
            final UIButton button = component.getBtBottomRight();
            button.setBackdrop(null);
            button.setBorder(new EmptyBorder());
            button.setPadding(new Insets(0, 0, 0, 0));
            button.setMargin(new Insets(0, 0, 0, 0));
            for (final UIState state : button.getStates()) {
                state.setBorder(null);
                state.setBackdrop(null);
            }
            button.setButtonText("");
            if (component.getOrientation() == Orientation.Horizontal) {
                button.setButtonIcon(new SubTex(_sharedTex, 147, 121, 16, 15));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 147, 137, 16, 15));
            } else {
                button.setButtonIcon(new SubTex(_sharedTex, 97, 137, 15, 16));
                button.getMouseOverState().setIcon(new SubTex(_sharedTex, 113, 137, 15, 16));
            }
        }
        {
            final UISlider slider = component.getSlider();
            slider.getBackPanel().setBorder(new EmptyBorder());
View Full Code Here

        applyTexture(tex, panel);
    }

    private void applyTexture(final Texture tex, final UIPanel panel) {
        final ImageBackdrop backdrop = new ImageBackdrop(new SubTex(tex, 0, 0, tex.getImage().getWidth(), -tex
                .getImage().getHeight()));
        panel.setBackdrop(backdrop);
    }
View Full Code Here

        container.detachAllChildren();

        balls = new BallComponent[ballCount];

        // Create a texture for our balls to use.
        final SubTex tex = new SubTex(TextureManager.load("images/ball.png",
                Texture.MinificationFilter.NearestNeighborNoMipMaps, TextureStoreFormat.GuessCompressedFormat, true));

        // Add balls
        for (int i = 0; i < balls.length; i++) {
            final BallComponent ballComp = new BallComponent("ball", tex, Ball.radius * 2, Ball.radius * 2, container
View Full Code Here

        panel.setLayout(new BorderLayout());

        final UIButton button = new UIButton("Button A");
        final Texture tex = TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear,
                false);
        button.setIcon(new SubTex(tex));
        button.setIconDimensions(new Dimension(26, 26));
        button.setGap(10);
        button.setLayoutData(BorderLayoutData.NORTH);
        button.setTooltipText("This is a tooltip!");
        panel.add(button);
View Full Code Here

        final MultiImageBackdrop multiImgBD = new MultiImageBackdrop(ColorRGBA.BLACK_NO_ALPHA);
        clockPanel.setBackdrop(multiImgBD);

        final Texture clockTex = TextureManager.load("images/clock.png", Texture.MinificationFilter.Trilinear, false);

        final TransformedSubTex clockBack = new TransformedSubTex(new SubTex(clockTex, 64, 65, 446, 446));

        final double scale = .333;
        clockBack.setPivot(new Vector2(.5, .5));
        clockBack.getTransform().setScale(scale);
        clockBack.setAlignment(Alignment.MIDDLE);
        clockBack.setPriority(0);
        multiImgBD.addImage(clockBack);

        final TransformedSubTex hour = new TransformedSubTex(new SubTex(clockTex, 27, 386, 27, 126));
        hour.setPivot(new Vector2(.5, 14 / 126f));
        hour.getTransform().setScale(scale);
        hour.setAlignment(Alignment.MIDDLE);
        hour.setPriority(1);
        multiImgBD.addImage(hour);

        final TransformedSubTex minute = new TransformedSubTex(new SubTex(clockTex, 0, 338, 27, 174));
        minute.setPivot(new Vector2(.5, 14 / 174f));
        minute.getTransform().setScale(scale);
        minute.setAlignment(Alignment.MIDDLE);
        minute.setPriority(2);
        multiImgBD.addImage(minute);
View Full Code Here

    }

    private UIPanel makeScrollPanel() {
        final Texture tex = TextureManager.load("images/clock.png", Texture.MinificationFilter.Trilinear, false);
        final UILabel comp = new UILabel("");
        comp.setIcon(new SubTex(tex));
        comp.updateIconDimensionsFromIcon();
        final UIScrollPanel panel = new UIScrollPanel(comp);
        return panel;
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.ui.util.SubTex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.