Skip to content

Commit

Permalink
avm2: Stub all remaining TextField methods and properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Jan 13, 2024
1 parent 639d17d commit 1958228
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions core/src/avm2/globals/flash/text/TextField.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package flash.text {
import flash.display.InteractiveObject;
import flash.display.DisplayObject;
import flash.geom.Rectangle;
import __ruffle__.stub_getter;
import __ruffle__.stub_setter;
import __ruffle__.stub_method;

Expand Down Expand Up @@ -154,5 +156,45 @@ package flash.text {
stub_method("flash.text.TextField", "getCharBoundaries");
return new Rectangle(0, 0, 1, 1);
}

public function getFirstCharInParagraph(charIndex:int):int {
stub_method("flash.text.TextField", "getFirstCharInParagraph");
return 0;
}

public function getImageReference(id:String):DisplayObject {
stub_method("flash.text.TextField", "getImageReference");
return null;
}

public function getLineIndexAtPoint(x:Number, y:Number):int {
stub_method("flash.text.TextField", "getLineIndexAtPoint");
return 0;
}

public function getLineIndexOfChar(charIndex:int):int {
stub_method("flash.text.TextField", "getLineIndexOfChar");
return 0;
}

public function getLineOffset(lineIndex:int):int {
stub_method("flash.text.TextField", "getLineOffset");
return 0;
}

public function getParagraphLength(charIndex:int):int {
stub_method("flash.text.TextField", "getParagraphLength");
return 0;
}

public static function isFontCompatible(fontName:String, fontStyle:String):Boolean {
stub_method("flash.text.TextField", "isFontCompatible");
return true;
}

public function get textInteractionMode():String {
stub_getter("flash.text.TextField", "textInteractionMode");
return TextInteractionMode.NORMAL;
}
}
}

0 comments on commit 1958228

Please sign in to comment.