`

Sprite转bitmap

 
阅读更多

假设我们有这样一种情况,一个sprite容器里有成百上千sprite,children-sprite,而其实他们就只是一个个没动效的图,为了节省内存,有必要把整个sprite变成一个bitmap。其方法如下:

var sprite:Sprite..............

var mix:Matrix = new Matrix();

mix.scale(1, 1);          //缩放比例
var bitmapData:BitmapData = new BitmapData(MAX_WIDTH, MAX_HEIGHT);
bitmapData.draw(sprite, mix);

这样就可以出来一个bitmapData,自然bitmap也就可以new出来了

 

分享到:
评论

相关推荐

    Unity游戏的字体在手机上忽大忽小吗? 用spritetext吧

    做出来后你游戏的中文字体文件就由几M变了几k. 老毛子写的。含数字和字母。中文字要自己用 Bitmap Font Generator做。 怎样自己做字体Assets\SpriteText\example 下有pdf说明

    Game programming all in one 3rd Edition

    Chapter 7 Basic Bitmap Handling and Blitting Chapter 8 Introduction to Sprite Programming Chapter 9 Sprite Animation Chapter 10 Advanced Sprite Programming Chapter 11 Programming the Perfect Game Loop...

    以二进制形式读取外部图片文件(AIR)

    package { import flash.display.Bitmap; ... var bitmap:Bitmap = Bitmap(event.target.loader.content); window.width = bitmap.width; window.height = bitmap.height + 30; } } }

    NGUI Next-Gen UI 3.0.4.unitypackage

    s no longer possible to set the sprite width and height to zero before assigning a sprite FIX: Raycasts that hit no widgets will now be ignored FIX: Fixed out of bounds exception when labels ended...

    水面杂点滤镜

    import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.BitmapDataChannel; import flash.display.Sprite; import flash.events.TimerEvent; import flash.filters....

    mielBitEd - Bitmap Editor (Palm OS)-开源

    Palm OS设备的位图编辑器。 将来的支持将包括切片视图和Sprite动画模式。 最终它将成为动作RPG游戏引擎的编辑器。

    开发Flash网络游戏需要掌握的技术

    开发Flash网络游戏需要掌握的技术,一个游戏离不开显示,AS3已经...学习这个部分,学习显示列表,学习DisplayObject和DisplayObjectContainer的区别,学习Shape, Sprite, MovieClip, Bitmap这些基本可显示对象的区别。

    Delphi下开发DirectX程序的最佳游戏开发控件包

    TDXDIB 容纳DIB(设备无关位图,Device Independent Bitmap)的组件 TDXImageList 图片列表组件 TDX3D Direct3D 组件 (和TDXDraw一起使用) TDXSound DirectSound 组件 TDXWave 容纳 Wave(波形音频文件)的组件 ...

    DelphiX 2000.07.17 For D7 (DirectX)

    组件列表:TDXDraw DirectDraw 和 Direct3D 组件TDXDIB 容纳DIB(设备无关位图,Device Independent Bitmap)的组件TDXImageList 图片列表组件TDX3D Direct3D 组件 (和TDXDraw一起使用)TDXSound DirectSound 组件...

    Apress.Learn.cocos2d.2.Game.Development.for.iOS

    PhysicsEditor (physics collision shapes), Particle Designer (particle effects), Glyph Designer (bitmap fonts), and others. This book offers a rock-solid introduction to creating games made entirely...

    Apress Learn Cocos2D

    PhysicsEditor (physics collision shapes), Particle Designer (particle effects), Glyph Designer (bitmap fonts), and others. This book offers a rock-solid introduction to creating games made entirely...

    phaser-manifest-loader:Phaser清单加载器

    spritesheets: [ 'creature1', 'creature2' ], 'bitmap_fonts': [ 'bitmapfont' ], 'audio': [ 'blip' ], 'images': [ 'phaser_logo', 'webpack_logo' ], fonts: { custom: { families: [ 'bebas...

    developing android application with adobe air.part4.rar

    Sprite Sheet and Blitting Custom Cursor Asynchronous Bitmap Decoding Caching Assets Components Conclusion Chapter 19 : Best Practices for Development Resources on Optimization Where to Find Help How ...

    developing android application with adobe air.part2.rar

    Sprite Sheet and Blitting Custom Cursor Asynchronous Bitmap Decoding Caching Assets Components Conclusion Chapter 19 : Best Practices for Development Resources on Optimization Where to Find Help How ...

    developing android application with adobe air.part3.rar

    Sprite Sheet and Blitting Custom Cursor Asynchronous Bitmap Decoding Caching Assets Components Conclusion Chapter 19 : Best Practices for Development Resources on Optimization Where to Find Help How ...

    developing android application with adobe air.part1

    Sprite Sheet and Blitting Custom Cursor Asynchronous Bitmap Decoding Caching Assets Components Conclusion Chapter 19 : Best Practices for Development Resources on Optimization Where to Find Help How ...

    SDL2_Tutorials

    11_clip_rendering_and_sprite_sheets 12_color_modulation 13_alpha_blending 14_animated_sprites_and_vsync 15_rotation_and_flipping 16_true_type_fonts 17_mouse_events 18_key_states 19_gamepads_and_...

    DelphiX 99.10.24 (DirectX游戏开发组件)

    组件列表:TDXDraw DirectDraw 和 Direct3D 组件 TDXDIB 容纳DIB(设备无关位图,Device Independent Bitmap)的组件 TDXImageList 图片列表组件 TDX3D Direct3D 组件 (和TDXDraw一起使用) TDXSound DirectSound ...

Global site tag (gtag.js) - Google Analytics