テクスチャ座標で使用される任意に逆転可能な 2D 変換です。最も一般的には、このクラスは
注意事項
例
例 | |
{define-class package QuickExampleWidget {inherits BaseFrame} field private texture-xform:TextureTransformation2d = {TextureTransformation2d} {constructor package {default texture-xform:TextureTransformation2d, ... } set self.texture-xform = texture-xform {construct-super ...} } {method public {draw r2d:Renderer2d}:void let bounds:GRect = {self.layout.get-bounds} {with-render-properties texture-transformation = self.texture-xform on r2d do {r2d.render-rectangle -bounds.lextent, -bounds.ascent, bounds.width, bounds.height, fill-pattern = {url "curl://install/docs/default/images/adria.jpg"}, uv1 = {Fraction2d 0, 0}, || try changing this. uv2 = {Fraction2d 1, 1} || try changing this. } } } } {let scaled-texture-xform:TextureTransformation2d = {TextureTransformation2d} } {let identity-texture-xform:TextureTransformation2d = {TextureTransformation2d} } {scaled-texture-xform.local-uniform-scale 2.0} || We have to do this so that we can make sure || that we create the graphics at the correct size. || (We want the graphic to be exactly the same || size as an unscaled image.) And the easiest || way to find the size of adria.jpg is to create || a Pixmap from the FillPattern. {let image:Pixmap = {{FillPattern.from-url {url "curl://install/docs/default/images/adria.jpg"}}.to-Pixmap}} {HBox {VBox {QuickExampleWidget identity-texture-xform, width = image.width, height = image.height }, {Fill height = 0.125in}, {text This shows the identity TextureTransformation2d. } }, {Fill width = 1in}, {VBox {QuickExampleWidget scaled-texture-xform, width = image.width, height = image.height }, {Fill height = 0.125in}, {text This shows a TextureTransformation2d which has been scaled by a factor of 2 in both dimensions. } } } |
四角形の仕様から |
マトリックス要素をコピーして |
self と同じ型のオブジェクトを作成して返します。 |
四角形の仕様から
説明
マトリックス要素をコピーして
self と同じ型のオブジェクトを作成して返します。
注意事項