hsyihao 发表于 2011-3-19 15:23:31

无意在网上看到的3D 文字测试,比较不错

[#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
本来想找点东西的,无意发现了这个```感觉不错```发出来大家学习```

menfan1 发表于 2011-3-20 10:46:47

很早就有啦呵呵官网的哦

chenlu_ling 发表于 2011-3-20 16:03:10

效果不错 收藏了

蜘蛛抱蛋 发表于 2011-3-21 10:47:25

很巧妙,把同一字母按照一定规律错开显示,形成类似阴影的效果,说3D有点夸张
页: [1]
查看完整版本: 无意在网上看到的3D 文字测试,比较不错