protected virtual bool InitWithSize(CCGridSize gridSize, CCSize size) { //ulong POTWide = ccNextPOT((uint) size.width); //ulong POTHigh = ccNextPOT((uint) size.width); ulong potWide = (uint)size.Width; ulong potHigh = (uint)size.Height; // we only use rgba8888 var format = CCTexture2DPixelFormat.RGBA8888; var pTexture = new CCTexture2D(); pTexture.InitWithData(null, format, (uint)potWide, (uint)potHigh, size); InitWithSize(gridSize, pTexture, false); return(true); }
public CCTexture2D AddImage(byte[] data, string assetName, SurfaceFormat format) { lock (m_pDictLock) { CCTexture2D texture; if (!m_pTextures.TryGetValue(assetName, out texture)) { texture = new CCTexture2D(); if (texture.InitWithData(data, format)) { m_pTextures.Add(assetName, texture); } else { return(null); } } return(texture); } }
protected virtual bool InitWithSize(CCGridSize gridSize, CCSize size) { //ulong POTWide = ccNextPOT((uint) size.width); //ulong POTHigh = ccNextPOT((uint) size.width); ulong potWide = (uint) size.Width; ulong potHigh = (uint) size.Height; // we only use rgba8888 var format = CCTexture2DPixelFormat.kCCTexture2DPixelFormat_RGBA8888; var pTexture = new CCTexture2D(); pTexture.InitWithData(null, format, (uint) potWide, (uint) potHigh, size); InitWithSize(gridSize, pTexture, false); return true; }