public CCNodeGrid(CCSize contentSize) : base(contentSize) { renderGrid = new CCCustomCommand(RenderGrid); renderBeginGrid = new CCCustomCommand(float.MinValue, OnGridBeginDraw); renderEndGrid = new CCCustomCommand(float.MaxValue, OnGridEndDraw); }
public IntroLayer() { // setup our color for the background Color = new CCColor3B(CCColor4B.Red); Opacity = 0; renderCommand = new CCCustomCommand(RenderUI); }
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(); }
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); }
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); }
void AddCustomCommandOnDraw(CCCustomCommand customCommandOnDraw) { var renderer = (Renderer != null) ? Renderer : DrawManager.Renderer; if (renderer != null) { renderer.AddCommand(customCommandOnDraw); } }
public CCRenderTexture() { beginCommand = new CCCustomCommand(float.MinValue, OnBegin); endCommand = new CCCustomCommand(float.MaxValue, OnEnd); PixelFormat = CCSurfaceFormat.Color; drawManager = CCDrawManager.SharedDrawManager; renderer = drawManager.Renderer; }
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(); }
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); }
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; }
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 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 CCNodeGrid(CCSize contentSize) : base(contentSize) { renderGrid = new CCCustomCommand(RenderGrid); }
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(); }
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; }