找回密码
 加入
搜索
查看: 1664|回复: 3

[AU3基础] 无意在网上看到的3D 文字测试,比较不错

  [复制链接]
发表于 2011-3-19 15:23:31 | 显示全部楼层 |阅读模式
[
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#Include <File.au3>
;written by taietel

;Example - modify to fit >>YOUR<< needs
GUICreate("3D Text", 650, 550)
GUISetBkColor(0x996600)

$arStyle=StringSplit("u|i|n|u|i|n","|",2)
For $i=0 To 5
    _3DText("AutoIt - 3D Text", 10, 20+80*$i, -1, -1, 14 + $i*10, "b", $arStyle[$i])
Next

GUISetState(@SW_SHOW)

While 1
    Sleep(10)
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _3DText($sText,$iX, $iY, $iW=-1, $iH=-1, $iFontSize = 14, $sWeight="b", $sStyle = "n", $sFont="Arial")
    If $iW = -1 Or $iW = Default Then $iW = Int(StringLen($sText)*$iFontSize/1.2)
    If $iH = -1 Or $iH = Default Then $iH = Int(1.5*$iFontSize)
    If $iFontSize = -1 Or $iFontSize = Default Then $iFontSize = 14
    If $sWeight = -1 Or $sWeight = Default Then $sWeight = "b"
    If $sStyle = -1 Or $sStyle = Default Then $sStyle = "n"
    If $sFont = -1 Or $sFont = Default Then $sFont = "Arial"
    Local $f = 0x111111
    Switch $sWeight
        Case "b"
            $iWeight = 800
        Case "n"
            $iWeight = 400
    EndSwitch
    Switch $sStyle
        Case "n"
            $iStyle = 0
        Case "i"
            $iStyle = 2
        Case "u"
            $iStyle = 4
    EndSwitch
    Local $iZ = $iFontSize/10
    For $i=0 To $iZ Step 0.5
        GUICtrlCreateLabel($sText, $iX-$i, $iY+$i, $iW, $iH)
        GUICtrlSetColor(-1,$f*($i+1)/0.5)
        GUICtrlSetFont(-1, $iFontSize, $iWeight, $iStyle, $sFont)
        GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
    Next
EndFunc
本来想找点东西的,无意发现了这个```感觉不错```发出来大家学习```

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-3-20 10:46:47 | 显示全部楼层
很早就有啦呵呵官网的哦
发表于 2011-3-20 16:03:10 | 显示全部楼层
效果不错 收藏了
发表于 2011-3-21 10:47:25 | 显示全部楼层
很巧妙,把同一字母按照一定规律错开显示,形成类似阴影的效果,说3D有点夸张
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 10:44 , Processed in 0.082392 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表