{curl 3.0 applet} {curl-file-attributes character-encoding = "shift-jis"} {title Drop Shadow} || テキストに影をつける {define-class public DropShadowText {inherits BaseFrame} field protected text:String field protected depth:Distance field protected shadow-color:FillPattern {constructor public {default s:String, shadow-depth:Distance = 2pt, shadow-color:FillPattern = {FillPattern "black"}, ...} set self.text = s set self.depth = shadow-depth set self.shadow-color = shadow-color {construct-super ...} } {method public {draw r2d:Renderer2d}:void let f:Font = {Font self.font-family, {if self.font-size isa int then self.font-size * 1pt else self.font-size }, weight = self.font-weight, style = self.font-style } {with-render-properties font = f on r2d do let start-x:Distance = 0m let start-y:Distance = {if self.font-size isa int then self.font-size * 1pt else self.font-size } || 影の描画 {r2d.render-string start-x + self.depth, start-y + self.depth, self.text, font = f, fill-pattern = self.shadow-color } || 文字列の描画 {r2d.render-string start-x, start-y, self.text, font = f, fill-pattern = self.color } } } } || ここから描画 {DropShadowText "ようこそ Shinta のページへ", color = "orange", font-weight = "bold", font-family = "MS ゴシック", font-size = 16pt, width = 4in, height = 0.5in, shadow-depth = 1pt, shadow-color = "gray" }