Beispiel #1
0
 public CCNodeGrid(CCSize contentSize) 
     : base(contentSize)
 {
     renderGrid = new CCCustomCommand(RenderGrid);
     renderBeginGrid = new CCCustomCommand(float.MinValue, OnGridBeginDraw);
     renderEndGrid = new CCCustomCommand(float.MaxValue, OnGridEndDraw); 
 }
Beispiel #2
0
 public IntroLayer()
 {
     // setup our color for the background
     Color = new CCColor3B(CCColor4B.Red);
     Opacity = 0;
     renderCommand = new CCCustomCommand(RenderUI);
 }
Beispiel #3
0
        CCTileMapLayer(CCTileSetInfo[] tileSetInfos, CCTileLayerInfo layerInfo, CCTileMapInfo mapInfo, CCTileMapCoordinates layerSize,
                       int totalNumberOfTiles, int tileCapacity)
        {
            tileRenderCommand = new CCCustomCommand(RenderTileMapLayer);

            this.mapInfo    = mapInfo;
            LayerName       = layerInfo.Name;
            LayerSize       = layerSize;
            Opacity         = layerInfo.Opacity;
            LayerProperties = new Dictionary <string, string>(layerInfo.Properties);

            TileCoordOffset = new CCTileMapCoordinates(layerInfo.TileCoordOffset);
            ContentSize     = LayerSize.Size * TileTexelSize * CCTileMapLayer.DefaultTexelToContentSizeRatios;

            TileGIDAndFlagsArray = layerInfo.TileGIDAndFlags;

            UpdateTileCoordsToNodeTransform();

            ParseInternalProperties();

            InitialiseTileAnimations();

            InitialiseDrawBuffers(tileSetInfos);

            GenerateMinVertexZ();
        }
Beispiel #4
0
 public CCNodeGrid(CCSize contentSize)
     : base(contentSize)
 {
     renderGrid      = new CCCustomCommand(RenderGrid);
     renderBeginGrid = new CCCustomCommand(float.MinValue, OnGridBeginDraw);
     renderEndGrid   = new CCCustomCommand(float.MaxValue, OnGridEndDraw);
 }
Beispiel #5
0
        public CCGeometryNode(int bufferSize = DefaultBufferSize)
        {
            geomRenderCommand = new CCCustomCommand(RenderBatch);

            indicesArray  = new CCRawList <short>(bufferSize * 2);
            verticesArray = new CCRawList <CCV3F_C4B_T2F>(bufferSize);
            batchItemList = new CCRawList <CCGeometryInstance>(bufferSize);
        }
Beispiel #6
0
        public CCGeometryNode(int bufferSize=DefaultBufferSize)
        {
            geomRenderCommand = new CCCustomCommand(RenderBatch);

            indicesArray = new CCRawList<short>(bufferSize * 2);
            verticesArray = new CCRawList<CCV3F_C4B_T2F>(bufferSize);
            batchItemList = new CCRawList<CCGeometryInstance>(bufferSize);
        }
Beispiel #7
0
        void AddCustomCommandOnDraw(CCCustomCommand customCommandOnDraw)
        {
            var renderer = (Renderer != null) ? Renderer : DrawManager.Renderer;

            if (renderer != null)
            {
                renderer.AddCommand(customCommandOnDraw);
            }
        }
Beispiel #8
0
        public CCRenderTexture()
        {
            beginCommand = new CCCustomCommand(float.MinValue, OnBegin);
            endCommand   = new CCCustomCommand(float.MaxValue, OnEnd);

            PixelFormat = CCSurfaceFormat.Color;
            drawManager = CCDrawManager.SharedDrawManager;
            renderer    = drawManager.Renderer;
        }
        public CCRenderTexture()
        {
            beginCommand = new CCCustomCommand(float.MinValue, OnBegin);
            endCommand = new CCCustomCommand(float.MaxValue, OnEnd);

            PixelFormat = CCSurfaceFormat.Color;
            drawManager = CCDrawManager.SharedDrawManager;
            renderer = drawManager.Renderer;
        }
Beispiel #10
0
        public CCProgressTimer(CCSprite sp)
        {
            timerRenderCommand = new CCCustomCommand(RenderProgress);

            AnchorPoint   = new CCPoint(0.5f, 0.5f);
            Type          = CCProgressTimerType.Radial;
            Midpoint      = new CCPoint(0.5f, 0.5f);
            BarChangeRate = new CCPoint(1, 1);
            Sprite        = sp;
            UpdateProgress();
        }
Beispiel #11
0
        void SetupCCLayerColor(CCColor4B?color = null)
        {
            layerRenderCommand = new CCCustomCommand(RenderLayer);

            var setupColor = (color.HasValue) ? color.Value : CCColor4B.Transparent;

            DisplayedColor   = RealColor = new CCColor3B(setupColor.R, setupColor.G, setupColor.B);
            DisplayedOpacity = RealOpacity = setupColor.A;
            BlendFunc        = CCBlendFunc.NonPremultiplied;
            UpdateColor();
        }
        public CCDrawNode()
        {
            renderTriangles = new CCCustomCommand(FlushTriangles);
            renderLines = new CCCustomCommand(FlushLines);
            renderStrings = new CCCustomCommand(DrawStrings);

            BlendFunc = CCBlendFunc.AlphaBlend;
            triangleVertices = new CCRawList<CCV3F_C4B>(DefaultBufferSize);
            lineVertices = new CCRawList<CCV3F_C4B>(DefaultBufferSize);

            verticeBounds = CCRect.Zero;
        }
        public IntroLayer()
            : base(CCColor4B.Blue)
        {

            renderDebugCommand = new CCCustomCommand(RenderDebug);

            InitPhysics();

            StartDebugging();

            Schedule(Run);
        }
Beispiel #14
0
        public CCDrawNode()
        {
            renderTriangles = new CCCustomCommand(FlushTriangles);
            renderLines     = new CCCustomCommand(FlushLines);
            renderStrings   = new CCCustomCommand(DrawStrings);

            BlendFunc        = CCBlendFunc.AlphaBlend;
            triangleVertices = new CCRawList <CCV3F_C4B>(DefaultBufferSize);
            lineVertices     = new CCRawList <CCV3F_C4B>(DefaultBufferSize);

            verticeBounds = CCRect.Zero;
        }
Beispiel #15
0
        internal void ProcessCustomRenderCommand(CCCustomCommand customCommand)
        {
            // We're changing command types so render any pending sequence of commands
            // e.g. Batched quad commands
            if ((currentCommandType & CCCommandType.Custom) == CCCommandType.None)
            {
                Flush();
            }

            customCommand.RenderCustomCommand(drawManager);

            currentCommandType = CCCommandType.Custom;
        }
 protected CCCustomCommand(CCCustomCommand copy)
     : base(copy)
 {
     Action = copy.Action; 
 }
 void InitRenderCommand()
 {
     quads = new CCRawList <CCV3F_C4B_T2F_Quad> (TotalParticles);
     renderParticlesCommand = new CCCustomCommand(RenderParticles);
 }
 void AddCustomCommandOnDraw(CCCustomCommand customCommandOnDraw)
 {
     var renderer = (Renderer != null) ? Renderer : DrawManager.Renderer;
     if (renderer != null)
     {
         renderer.AddCommand(customCommandOnDraw);
     }
 }
 protected CCCustomCommand(CCCustomCommand copy)
     : base(copy)
 {
     Action = copy.Action;
 }
Beispiel #20
0
        void SetupCCLayerColor(CCColor4B? color = null)
        {
            layerRenderCommand = new CCCustomCommand(RenderLayer);

            var setupColor = (color.HasValue) ? color.Value : CCColor4B.Transparent;
            DisplayedColor = RealColor = new CCColor3B(setupColor.R, setupColor.G, setupColor.B);
            DisplayedOpacity = RealOpacity = setupColor.A;
            BlendFunc = CCBlendFunc.NonPremultiplied;
            UpdateColor();
        }
Beispiel #21
0
 public CCNodeGrid(CCSize contentSize)
     : base(contentSize)
 {
     renderGrid = new CCCustomCommand(RenderGrid);
 }
Beispiel #22
0
        CCTileMapLayer(CCTileSetInfo[] tileSetInfos, CCTileLayerInfo layerInfo, CCTileMapInfo mapInfo, CCTileMapCoordinates layerSize,
            int totalNumberOfTiles, int tileCapacity)
        {
            tileRenderCommand = new CCCustomCommand(RenderTileMapLayer);

            this.mapInfo = mapInfo;
            LayerName = layerInfo.Name;
            LayerSize = layerSize;
            Opacity = layerInfo.Opacity;
            LayerProperties = new Dictionary<string, string>(layerInfo.Properties);

            TileCoordOffset = new CCTileMapCoordinates(layerInfo.TileCoordOffset);
            ContentSize = LayerSize.Size * TileTexelSize * CCTileMapLayer.DefaultTexelToContentSizeRatios;

            TileGIDAndFlagsArray = layerInfo.TileGIDAndFlags;

            UpdateTileCoordsToNodeTransform();

            ParseInternalProperties();

            InitialiseTileAnimations();

            InitialiseDrawBuffers(tileSetInfos);

            GenerateMinVertexZ();
        }
Beispiel #23
0
        internal void ProcessCustomRenderCommand(CCCustomCommand customCommand)
        {
            // We're changing command types so render any pending sequence of commands
            // e.g. Batched quad commands
            if((currentCommandType & CCCommandType.Custom) == CCCommandType.None)
                Flush();

            customCommand.RenderCustomCommand(drawManager);

            currentCommandType = CCCommandType.Custom;
        }
        public CCProgressTimer(CCSprite sp)
        {
            timerRenderCommand = new CCCustomCommand(RenderProgress);

            AnchorPoint = new CCPoint(0.5f, 0.5f);
            Type = CCProgressTimerType.Radial;
            Midpoint = new CCPoint(0.5f, 0.5f);
            BarChangeRate = new CCPoint(1, 1);
            Sprite = sp;
            UpdateProgress();
        }