mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Add TextItem documentation.
This commit is contained in:
parent
5bd935be75
commit
24689300c3
1 changed files with 35 additions and 1 deletions
|
@ -15,8 +15,21 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var TextItem = this.TextItem = Item.extend({
|
var TextItem = this.TextItem = Item.extend({
|
||||||
|
/** @lends TextItem# */
|
||||||
|
|
||||||
beans: true,
|
beans: true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructs TextItem
|
||||||
|
*
|
||||||
|
* @class The TextItem type allows you to create typography. Its
|
||||||
|
* functionality is inherited by different text item types such as
|
||||||
|
* {@link PointText}, and {@link AreaText} (coming soon). They each add a
|
||||||
|
* layer of functionality that is unique to their type, but share the
|
||||||
|
* underlying properties and functions that they inherit from TextItem.
|
||||||
|
*
|
||||||
|
* @extends Item
|
||||||
|
*/
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.base();
|
this.base();
|
||||||
this.content = null;
|
this.content = null;
|
||||||
|
@ -26,12 +39,27 @@ var TextItem = this.TextItem = Item.extend({
|
||||||
this.setParagraphStyle();
|
this.setParagraphStyle();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The text contents of the text item.
|
||||||
|
*
|
||||||
|
* @name TextItem#content
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
|
||||||
_clone: function(copy) {
|
_clone: function(copy) {
|
||||||
copy.setCharacterStyle(this._characterStyle);
|
copy.setCharacterStyle(this._characterStyle);
|
||||||
copy.setParagraphStyle(this._paragraphStyle);
|
copy.setParagraphStyle(this._paragraphStyle);
|
||||||
return this.base(copy);
|
return this.base(copy);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@grouptitle Style Properties}
|
||||||
|
*
|
||||||
|
* The character style of the text item.
|
||||||
|
*
|
||||||
|
* @type CharacterStyle
|
||||||
|
* @bean
|
||||||
|
*/
|
||||||
getCharacterStyle: function() {
|
getCharacterStyle: function() {
|
||||||
return this._characterStyle;
|
return this._characterStyle;
|
||||||
},
|
},
|
||||||
|
@ -39,7 +67,13 @@ var TextItem = this.TextItem = Item.extend({
|
||||||
setCharacterStyle: function(style) {
|
setCharacterStyle: function(style) {
|
||||||
this._characterStyle.initialize(style);
|
this._characterStyle.initialize(style);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The paragraph style of the text item.
|
||||||
|
*
|
||||||
|
* @type ParagraphStyle
|
||||||
|
* @bean
|
||||||
|
*/
|
||||||
getParagraphStyle: function() {
|
getParagraphStyle: function() {
|
||||||
return this._paragraphStyle;
|
return this._paragraphStyle;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue