Ejemplo n.º 1
0
        public ActiveGraphic addGraphicsCompositeToRenderer(GraphicComposite graphic)
        {

            try
            {
                ActiveGraphic newActiveGraphic = new ActiveGraphic(graphic);
                newActiveGraphic.listPosition = activeSpriteCompositeList.add(newActiveGraphic);
                return newActiveGraphic;
            }

            catch (ClassCastException exc)
            {
                System.err.println("Rendering Engine attempted to add spriteless entity.");
                return null;
            }

        }
Ejemplo n.º 2
0
        public ActiveGraphic addGraphicsCompositeToRenderer(GraphicComposite graphic, int layer)
        {

            try
            {
                ActiveGraphic newActiveGraphic = new ActiveGraphic(graphic);

                layersList[layer].addGraphicToLayer(graphic);

                return newActiveGraphic;
            }

            catch (ClassCastException exc)
            {
                System.err.println("Rendering Engine attempted to add spriteless entity.");
                return null;
            }

        }
Ejemplo n.º 3
0
        private void PrintStars(Graphics Graphics)
        {
            // Create stars
            Star star1 = new Star(30, 30, Color.Red, Graphics);
            Star star2 = new Star(370, 20, Color.Blue, Graphics);
            Star star3 = new Star(350, 90, Color.Green, Graphics);
            Star star4 = new Star(110, 35, Color.Pink, Graphics);
            Star star5 = new Star(310, 70, Color.Yellow, Graphics);
            Star star6 = new Star(175, 10, Color.Violet, Graphics);
            Star star7 = new Star(350, 50, Color.LimeGreen, Graphics);
            Star star8 = new Star(300, 250, Color.Orange, Graphics);
            Star star9 = new Star(410, 80, Color.Lavender, Graphics);

            // Create composite
            GraphicComposite graphicCompositeMain = new GraphicComposite();
            GraphicComposite graphicComposite1    = new GraphicComposite();
            GraphicComposite graphicComposite2    = new GraphicComposite();
            GraphicComposite graphicComposite3    = new GraphicComposite();

            // Add stars to composite
            graphicComposite1.Add(star1);
            graphicComposite1.Add(star3);
            graphicComposite1.Add(star5);

            graphicComposite2.Add(star2);
            graphicComposite2.Add(star4);
            graphicComposite2.Add(star6);

            graphicComposite3.Add(star7);
            graphicComposite3.Add(star8);
            graphicComposite3.Add(star9);

            // Add composite to main
            graphicCompositeMain.Add(graphicComposite1);
            graphicCompositeMain.Add(graphicComposite2);
            graphicCompositeMain.Add(graphicComposite3);

            // Paint
            graphicCompositeMain.Paint();
        }
Ejemplo n.º 4
0
        /* #########################################################################################################################
         *		Composite Nullifier Methods
         * #########################################################################################################################
         */

        protected void nullifyGraphicsComposite()
        {
            this.graphicsComposite = GraphicComposite.nullGraphicsComposite();
        }
Ejemplo n.º 5
0
        /*######################################################################################################################
         *      COMPOSITE GET/SETTERS
         * Getters are public, Setters are protected to be used by CompositeFactory
         * #####################################################################################################################
         */

        protected void setGraphicComposite(GraphicComposite spriteType)
        {
            this.graphicsComposite = spriteType;
        }
Ejemplo n.º 6
0
 public void notifyRenderingEngineOfDisabledGraphic()
 {
     composite = null;
     listPosition.removeSelfFromList();
     listPosition = null;
 }
Ejemplo n.º 7
0
 protected ActiveGraphic(GraphicComposite composite)
 {
     this.composite = composite;
 }