Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pbTextSprite(viewport = nil, type = "System")
- sprite = Sprite.new(viewport)
- sprite.z = 99999
- sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
- eval("pbSet#{type}Font(sprite.bitmap)")
- return sprite
- end
- If you just want a sprite for a type icon, you can just do "mySprite = pbTypeSprite(type, viewport)" with this. Type should be a number or a "PBMove" object.
- def pbTypeSprite(type, viewport = nil)
- type = type.type if type.is_a?(PBMove)
- sprite = Sprite.new(viewport)
- sprite.bmp("Graphics/Pictures/types")
- sprite.src_rect.height = sprite.bitmap.height / PBTypes.getCount
- sprite.src_rect.y = sprite.src_rect.height * type
- return sprite
- end
- Example:
- mySprite = pbTypeSprite(0, @viewport)
- This sprite is now the icon of the Normal type. If it does not work properly, the types.txt PBS file and the types.png sheet may not have the same amount of types.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement