mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 17:16:03 +00:00
1 line
No EOL
22 KiB
JSON
1 line
No EOL
22 KiB
JSON
{"class":{"name":"Phaser.RetroFont","extends":"Phaser.RenderTexture","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"Current game instance.","optional":false,"default":null},{"name":"key","type":["string"],"help":"The font set graphic set as stored in the Game.Cache.","optional":false,"default":null},{"name":"characterWidth","type":["number"],"help":"The width of each character in the font set.","optional":false,"default":null},{"name":"characterHeight","type":["number"],"help":"The height of each character in the font set.","optional":false,"default":null},{"name":"chars","type":["string"],"help":"The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.","optional":false,"default":null},{"name":"charsPerRow","type":["number"],"help":"The number of characters per row in the font set. If not given charsPerRow will be the image width \/ characterWidth.","optional":true,"default":null},{"name":"xSpacing","type":["number"],"help":"If the characters in the font set have horizontal spacing between them set the required amount here.","optional":true,"default":"0"},{"name":"ySpacing","type":["number"],"help":"If the characters in the font set have vertical spacing between them set the required amount here.","optional":true,"default":"0"},{"name":"xOffset","type":["number"],"help":"If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.","optional":true,"default":"0"},{"name":"yOffset","type":["number"],"help":"If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.","optional":true,"default":"0"}],"help":"A Retro Font is similar to a BitmapFont, in that it uses a texture to render the text. However unlike a BitmapFont every character in a RetroFont\\nis the same size. This makes it similar to a sprite sheet. You typically find font sheets like this from old 8\/16-bit games and demos."},"consts":[{"name":"","type":"string","help":"","line":282},{"name":"\/0123456789:;<","type":"string","help":"","line":219},{"name":"?06DJPV,","type":"string","help":"","line":254},{"name":"ABCDEFGHIJKLMNO","type":"string","help":"","line":261},{"name":"ALIGN_CENTER","type":"string","help":"","line":205},{"name":"ALIGN_LEFT","type":"string","help":"","line":191},{"name":"ALIGN_RIGHT","type":"string","help":"","line":198},{"name":"TEXT_SET10","type":"string","help":"","line":275},{"name":"TEXT_SET3","type":"string","help":"","line":226},{"name":"TEXT_SET4","type":"string","help":"","line":233}],"methods":{"public":[{"name":"addTextureToCache","static":true,"returns":null,"help":"Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.","line":292,"public":true,"protected":false,"private":false,"parameters":[{"name":"texture","type":["PIXI.Texture"],"help":"The Texture to add to the cache.","optional":false,"default":null},{"name":"id","type":["string"],"help":"The id that the texture will be stored against.","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"buildRetroFontText","static":false,"returns":null,"help":"Updates the texture with the new text.","line":343,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"clear","static":false,"returns":null,"help":"Clears the RenderTexture.","line":176,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"destroy","static":false,"returns":null,"help":"Destroys this texture","line":155,"public":true,"protected":false,"private":false,"parameters":[{"name":"destroyBase","type":["boolean"],"help":"Whether to destroy the base texture as well","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"fromCanvas","static":true,"returns":{"types":[],"help":[]},"help":"Helper function that creates a new a Texture based on the given canvas element.","line":276,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["PIXI.Canvas"],"help":"The canvas element source of the texture","optional":false,"default":null},{"name":"scaleMode","type":["number"],"help":"Should be one of the PIXI.scaleMode consts","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"fromFrame","static":true,"returns":{"types":[],"help":[]},"help":"Helper function that returns a Texture objected based on the given frame id.\\nIf the frame id is not in the texture cache an error will be thrown.","line":260,"public":true,"protected":false,"private":false,"parameters":[{"name":"frameId","type":["string"],"help":"The frame id of the texture","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"fromImage","static":true,"returns":{"types":[],"help":[]},"help":"Helper function that creates a Texture object from the given image url.\\nIf the image is not in the texture cache it will be created and loaded.","line":238,"public":true,"protected":false,"private":false,"parameters":[{"name":"imageUrl","type":["string"],"help":"The image url of the texture","optional":false,"default":null},{"name":"crossorigin","type":["boolean"],"help":"Whether requests should be treated as crossorigin","optional":false,"default":null},{"name":"scaleMode","type":["number"],"help":"Should be one of the PIXI.scaleMode consts","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"getBase64","static":false,"returns":{"types":["string"],"help":"A base64 encoded string of the texture."},"help":"Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.","line":294,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"getCanvas","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"A Canvas element with the texture rendered on."},"help":"Creates a Canvas element, renders this RenderTexture to it and then returns it.","line":305,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"getImage","static":false,"returns":{"types":["Image"],"help":""},"help":"Will return a HTML Image of the texture","line":281,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"getLongestLine","static":false,"returns":{"types":["number"],"help":"The length of the longest line of text."},"help":"Works out the longest line of text in _text and returns its length","line":477,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"pasteLine","static":false,"returns":null,"help":"Internal function that takes a single line of text (2nd parameter) and pastes it into the BitmapData at the given coordinates.\\nUsed by getLine and getMultiLine","line":439,"public":true,"protected":false,"private":false,"parameters":[{"name":"line","type":["string"],"help":"The single line of text to paste.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate.","optional":false,"default":null},{"name":"customSpacingX","type":["number"],"help":"Custom X spacing.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"removeTextureFromCache","static":true,"returns":{"types":["PIXI.Texture"],"help":"The texture that was removed"},"help":"Remove a texture from the global PIXI.TextureCache.","line":305,"public":true,"protected":false,"private":false,"parameters":[{"name":"id","type":["string"],"help":"The id of the texture to be removed","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"render","static":false,"returns":null,"help":"This function will draw the display object to the texture.","line":90,"public":true,"protected":false,"private":false,"parameters":[{"name":"displayObject","type":["Phaser.Sprite","Phaser.Image","Phaser.Text","Phaser.BitmapText","Phaser.Group"],"help":" The display object to render to this texture.","optional":false,"default":null},{"name":"position","type":["Phaser.Point"],"help":"A Point object containing the position to render the display object at.","optional":false,"default":null},{"name":"clear","type":["boolean"],"help":"If true the texture will be cleared before the display object is drawn.","optional":false,"default":null}],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"renderXY","static":false,"returns":null,"help":"This function will draw the display object to the texture.","line":66,"public":true,"protected":false,"private":false,"parameters":[{"name":"displayObject","type":["Phaser.Sprite","Phaser.Image","Phaser.Text","Phaser.BitmapText","Phaser.Group"],"help":" The display object to render to this texture.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x position to render the object at.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y position to render the object at.","optional":false,"default":null},{"name":"clear","type":["boolean"],"help":"If true the texture will be cleared before the display object is drawn.","optional":false,"default":null}],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"resize","static":false,"returns":null,"help":"Resizes the RenderTexture.","line":145,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"The width to resize to.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height to resize to.","optional":false,"default":null},{"name":"updateBase","type":["boolean"],"help":"Should the baseTexture.width and height values be resized as well?","optional":false,"default":null}],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"setFixedWidth","static":false,"returns":null,"help":"If you need this RetroFont to have a fixed width and custom alignment you can set the width here.\\nIf text is wider than the width specified it will be cropped off.","line":293,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"Width in pixels of this RetroFont. Set to zero to disable and re-enable automatic resizing.","optional":false,"default":null},{"name":"lineAlignment","type":["string"],"help":"Align the text within this width. Set to RetroFont.ALIGN_LEFT (default), RetroFont.ALIGN_RIGHT or RetroFont.ALIGN_CENTER.","optional":true,"default":"'left'"}],"inherited":false,"inheritedFrom":""},{"name":"setFrame","static":false,"returns":null,"help":"Specifies the region of the baseTexture that this texture will use.","line":168,"public":true,"protected":false,"private":false,"parameters":[{"name":"frame","type":["Phaser.Rectangle"],"help":"The frame of the texture to set it to","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"setText","static":false,"returns":null,"help":"A helper function that quickly sets lots of variables at once, and then updates the text.","line":314,"public":true,"protected":false,"private":false,"parameters":[{"name":"content","type":["string"],"help":"The text of this sprite.","optional":false,"default":null},{"name":"multiLine","type":["boolean"],"help":"Set to true if you want to support carriage-returns in the text and create a multi-line sprite instead of a single line.","optional":true,"default":"false"},{"name":"characterSpacing","type":["number"],"help":"To add horizontal spacing between each character specify the amount in pixels.","optional":true,"default":"0"},{"name":"lineSpacing","type":["number"],"help":"To add vertical spacing between each line of text, set the amount in pixels.","optional":true,"default":"0"},{"name":"lineAlignment","type":["string"],"help":"Align each line of multi-line text. Set to RetroFont.ALIGN_LEFT, RetroFont.ALIGN_RIGHT or RetroFont.ALIGN_CENTER.","optional":true,"default":"'left'"},{"name":"allowLowerCase","type":["boolean"],"help":"Lots of bitmap font sets only include upper-case characters, if yours needs to support lower case then set this to true.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"updateOffset","static":false,"returns":null,"help":"Updates the x and\/or y offset that the font is rendered from. This updates all of the texture frames, so be careful how often it is called.\\nNote that the values given for the x and y properties are either ADDED to or SUBTRACTED from (if negative) the existing offsetX\/Y values of the characters.\\nSo if the current offsetY is 8 and you want it to start rendering from y16 you would call updateOffset(0, 8) to add 8 to the current y offset.","line":535,"public":true,"protected":false,"private":false,"parameters":[{"name":"xOffset","type":["number"],"help":"If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.","optional":true,"default":"0"},{"name":"yOffset","type":["number"],"help":"If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"removeUnsupportedCharacters","static":false,"returns":{"types":["string"],"help":" A clean version of the string."},"help":"Internal helper function that removes all unsupported characters from the _text String, leaving only characters contained in the font set.","line":506,"public":false,"protected":true,"private":false,"parameters":[{"name":"stripCR","type":["boolean"],"help":"Should it strip carriage returns as well?","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""}],"private":[],"static":[]},"properties":{"public":[{"name":"align","type":["string"],"help":"","inlineHelp":"Alignment of the text when multiLine = true or a fixedWidth is set. Set to RetroFont.ALIGN_LEFT (default), RetroFont.ALIGN_RIGHT or RetroFont.ALIGN_CENTER.","line":77,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"autoUpperCase","type":["boolean"],"help":"","inlineHelp":"Automatically convert any text to upper case. Lots of old bitmap fonts only contain upper-case characters, so the default is true.","line":89,"default":"true","public":true,"protected":false,"private":false,"readOnly":false},{"name":"baseTexture","type":["PIXI.BaseTexture"],"help":"The base texture object that this texture uses","inlineHelp":"","line":84,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"characterHeight","type":["number"],"help":"","inlineHelp":"The height of each character in the font set.","line":45,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"characterPerRow","type":["number"],"help":"","inlineHelp":"The number of characters per row in the font set.","line":60,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"characterSpacingX","type":["number"],"help":"","inlineHelp":"If the characters in the font set have horizontal spacing between them set the required amount here.","line":50,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"characterSpacingY","type":["number"],"help":"","inlineHelp":"If the characters in the font set have vertical spacing between them set the required amount here.","line":55,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"characterWidth","type":["number"],"help":"","inlineHelp":"The width of each character in the font set.","line":40,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"crop","type":["Phaser.Rectangle"],"help":"This is the area of the BaseTexture image to actually copy to the Canvas \/ WebGL when rendering,\\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)","inlineHelp":"","line":76,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"customSpacingX","type":["number"],"help":"","inlineHelp":"Adds horizontal spacing between each character of the font, in pixels.","line":95,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"customSpacingY","type":["number"],"help":"","inlineHelp":"Adds vertical spacing between each line of multi-line text, set in pixels.","line":101,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"fixedWidth","type":["number"],"help":"If you need this RetroFont image to have a fixed width you can set the width in this value.\\nIf text is wider than the width specified it will be cropped off.","inlineHelp":"","line":108,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"fontSet","type":["Image"],"help":"","inlineHelp":"A reference to the image stored in the Game.Cache that contains the font.","line":113,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"frame","type":["Phaser.Rectangle"],"help":"The framing rectangle of the render texture","inlineHelp":"","line":67,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"frameData","type":["Phaser.FrameData"],"help":"","inlineHelp":"The FrameData representing this Retro Font.","line":130,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running game.","line":31,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"height","type":["number"],"help":"The height of the render texture","inlineHelp":"","line":51,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"key","type":["string"],"help":"","inlineHelp":"The key of the RenderTexture in the Cache, if stored there.","line":36,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"matrix","type":["PIXI.Matrix"],"help":"","inlineHelp":"The matrix that is applied when display objects are rendered to this RenderTexture.","line":46,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"multiLine","type":["boolean"],"help":"","inlineHelp":"If set to true all carriage-returns in text will form new lines (see align). If false the font will only contain one single line of text (the default)","line":83,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"noFrame","type":["boolean"],"help":"Does this Texture have any frame data assigned to it?","inlineHelp":"","line":30,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"offsetX","type":["number"],"help":"","inlineHelp":"If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.","line":66,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"offsetY","type":["number"],"help":"","inlineHelp":"If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.","line":72,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"renderer","type":["PIXI.CanvasRenderer","PIXI.WebGLRenderer"],"help":"The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.","inlineHelp":"","line":105,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"requiresUpdate","type":["boolean"],"help":"This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)","inlineHelp":"","line":81,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"resolution","type":["number"],"help":"The Resolution of the texture.","inlineHelp":"","line":59,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"stamp","type":["Phaser.Image"],"help":"","inlineHelp":"The image that is stamped to the RenderTexture for each character in the font.","line":172,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"text","type":["string"],"help":"","inlineHelp":"Set this value to update the text in this sprite. Carriage returns are automatically stripped out if multiLine is false. Text is converted to upper case if autoUpperCase is true.","line":602,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"trim","type":["Phaser.Rectangle"],"help":"The texture trim data.","inlineHelp":"","line":65,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"type","type":["number"],"help":"","inlineHelp":"Base Phaser object type.","line":179,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"valid","type":["boolean"],"help":"","inlineHelp":"","line":129,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"width","type":["number"],"help":"The with of the render texture","inlineHelp":"","line":43,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_text","type":["string"],"help":"","inlineHelp":"The text of the font image.","line":119,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"grabData","type":["array"],"help":"","inlineHelp":"An array of rects for faster character pasting.","line":125,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}} |