18997 发表于 2010-12-1 22:14:29

怎么弄滚动字体(已解决)

本帖最后由 18997 于 2013-7-18 22:43 编辑

让字体在窗体内滚动起来要怎么弄呢?

解决方法
用GUICtrlSetPos配合数学函数
在楼下几楼

tryhi 发表于 2010-12-1 22:17:09

本帖最后由 tryhi 于 2012-7-9 01:13 编辑

横向滚动
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 300, 192, 124)
$Label1 = GUICtrlCreateLabel("横向滚动", 0, 100, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
      For $i = 1 To 500
                GUICtrlSetPos($Label1, $i, 100)
                Sleep(10)
      Next
      Sleep(100)
WEnd


波浪形滚动
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 300, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 0, 100, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
      For $x = 1 To 500
                $y = 30 * Sin(0.05 * $x)
                GUICtrlSetPos($Label1, $x, 100 + $y)
                Sleep(10)
      Next
      Sleep(10)
WEnd


圆形滚动#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 300, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 0, 100, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        For $x = -100 To 100
                $y = Sqrt(100 ^ 2 - $x ^ 2)
                GUICtrlSetPos($Label1, $x + 100, 100 + $y)
                Sleep(10)
        Next
                For $x = 100 To -100 Step -1
                $y = Sqrt(100 ^ 2 - $x ^ 2)
                GUICtrlSetPos($Label1, $x + 100, 100 - $y)
                Sleep(10)
        Next
        Sleep(10)
WEnd

lxz 发表于 2010-12-2 16:31:30

收藏学习...

smking0204 发表于 2010-12-18 13:36:21

太威了啦!!tryhi大大..還有波浪型滾動的........

ollydbg 发表于 2012-5-23 17:49:27

在关闭窗口的时候,响应慢了点

邪恶海盗 发表于 2012-5-23 19:03:56

不错不错,收藏备用...

邪恶海盗 发表于 2012-5-23 19:08:35

问一下,从右往左滚动咋整的???

parr 发表于 2012-8-31 22:53:34

在关闭窗口的时候,响应慢了点

xzh531 发表于 2017-6-13 17:10:51

这方法问题多多

jingzhinvr 发表于 2017-7-2 00:12:08

有人能写个更完美的吗?期待高手写个更完美的

zxxputian2 发表于 2017-12-23 18:01:14

不错,谢谢提供

blue003 发表于 2019-6-27 10:22:52

还是用图像比较好

qxguoxing 发表于 2019-6-27 13:59:07

有意思,学习了。
页: [1]
查看完整版本: 怎么弄滚动字体(已解决)