これは取得できないんでしょうか?おあー?
こまったぞな。
こんな感じ。「1」しかかえってこねえよ。なして?
これは取得できないんでしょうか?おあー?
こまったぞな。
こんな感じ。「1」しかかえってこねえよ。なして?
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
Google reCAPTCHA helps protect websites from spam and abuse by verifying user interactions through challenges.
Google Tag Manager simplifies the management of marketing tags on your website without code changes.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
Marketing cookies are used to follow visitors to websites. The intention is to show ads that are relevant and engaging to the individual user.
A video-sharing platform for users to upload, view, and share videos across various genres and topics.
Service URL: www.youtube.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy policy.
「embedFonts=trueにおけるmaxscroll」への3件の返信
んーっとなんかうまく行くときと行かないときの区分が微妙・・。
—-
var temp = new TextFormat();
temp.size = 25;
temp.font = “Arial”;
aaa.setNewTextFormat(temp);
aaa.text = “ABCDEFGHIJKLMNOPQRSTU”;
aaa.embedFonts = true;
trace(aaa.maxscroll);
—-
これだと動作したりとか・・・。
経過報告
—-
どーもtextの代入を先にやるとmaxscrollが取得できないっぽいです。元々今回のタスクとしては決められたエリアのテキストフィールドにテキストを代入して溢れた場合、autoSize処理ではなく、フォントのサイズを縮小して表示していこうということで、textFieldクラスを拡張しようと。そういう感じで以下のようになりました。
—-
TextField.prototype.setHkw6 = function(arg, argTx) {
this.embedFonts = true;
if (argTx) {
this.text = argTx;
}
var temp = new TextFormat();
temp.size = arg;
temp.font = “Arial”;
this.setTextFormat(temp);
if (this.maxscroll>1) {
trace(“y=”+this._y);
this._y += 1;
this._height -= 1;
this.setHkw6(arg-1, argTx);
}
};
—-
一応フォントサイズの縮小に伴う改行処理の発生+vertical方向への座標のズレを修正しています。ま、これちょっと引数として内容を渡すのどうよ?ってところがあるので多分もう少しスマートな感じに直す予定。
経過報告2
代入テキストを引数にするのをやめました。
一度先にテキスト代入しておいてから一度関数内でテキストを引き出して再度設定。と言う感じで対応。
この辺既存のものは既存のもの、セットとして動作するものは関数と言う風に切り分けてみました。
ま、そもそもこの対応だと100文字あったら豆粒のようになって見えなくなるよ!って問題を孕んではいるのですけど。