Что нового

Текстовые Эффекты UDF

Zaramot

I ♥ AutoIt
Сообщения
1,160
Репутация
660
AutoIt: 3.3.6.1

Версия UDF: 1.9.3

Категория: Графика / GDI+,Элементы GUI

Описание:
Данная библиотека предназначена для придания различных текстовых эффектов таких контролов как: Label, Input, Combo, Edit, Button, List. В комплект так-же входит и Text Effects Disigner версии 0.95, добавьте его в SciTE Tools Menu (если хотите :smile:).

Как добавить внешнюю программу в SciTE -> Tools Menu ?

Функции:
_txt_eff__about_messages
_txt_eff__airport
_txt_eff__blink
_txt_eff__broad
_txt_eff__color_sequence
_txt_eff__color_to_color
_txt_eff__enlarge_from_left
_txt_eff__enlarge_from_right
_txt_eff__mix_up_chars
_txt_eff__move_cap_char_through_text
_txt_eff__move_in_from_left
_txt_eff__move_in_from_right
_txt_eff__move_out_to_left
_txt_eff__move_out_to_right
_txt_eff__move_small_char_through_text
_txt_eff__move_string_through_text
_txt_eff__raining
_txt_eff__rainbow
_txt_eff__scroll_through_options
_txt_eff__show_text_behind_char
_txt_eff__small
_txt_eff__spin
_txt_eff__spotlight
_txt_eff__style
_txt_eff__uncover_from_wall_to_wall
_txt_eff__wave
_txt_eff__zoom

Код/Пример:
Код:
; ----------------------------------------------------------------------------
;
; AutoIt Version: > 3.1.1.66
; Author:         peethebee < peter_opali @ gmx . de >
;
; Script Function:
;	Demonstration of the text effect UDF.
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include "text_effects.au3"
#include <GUIConstants.au3>

HotKeySet("^+m", "Quit")

Dim $credits[3], $times[4], $start[3], $start_times[3], $options[6], $parts[2], $about[8]
$about[0] = "=== Coder ==="
$about[1] = "peethebee"
$about[2] = ""
$about[3] = "=== Date ==="
$about[4] = "2005"
$about[5] = ""
$about[6] = "=== The End! ==="
$about[7] = "======\_/======="
$credits[0] = "Coder:  p e e t h e b e e ,  2005"
$credits[1] = "Thanks to: J. Bennett and team, the forum members..."
$credits[2] = "and to YOU, if you post your experiences in forum"
$start[0] = "peethebee Entertainment presents"
$start[1] = "an AutoIt UDF show"
$start[2] = '"T e x t  E f f e c t s   1 . 9 . 3"'
$start_times[0] = 1500
$start_times[1] = 1250
$start_times[2] = 2500
$times[0] = 2500
$times[1] = 1500
$times[2] = 1000
$times[3] = 10
$options[0] = "Option 1"
$options[1] = "Option 2"
$options[2] = "Option 3"
$options[3] = "Option 4"
$options[4] = "Option 5"
$options[5] = "Option 6"
$parts[0] = 4
$parts[1] = 10

$guiwin = GUICreate("Test", 500, 500)
GUISetState()
$label = GUICtrlCreateLabel("original text", 25, 25, 450, 60)
GUICtrlSetFont(-1, -1, -1, -1, "Courier New")
$input = GUICtrlCreateInput("original text", 25, 250, 450, 20) ;, 60, $ES_CENTER)
GUICtrlSetFont(-1, -1, -1, -1, "Courier New")


_txt_eff__about_messages($guiwin, $label, $start, 50, $start_times, 750, "zoom_big_to_small");zoom_big_to_small
Sleep(500)
GUICtrlSetFont($label, 9, -1, -1, "Courier New")
_txt_eff__enlarge_from_left ($guiwin, $label, "This is a text uncovered from left to right quite slowly!", 75, -1)
Sleep(500)
_txt_eff__enlarge_from_right ($guiwin, $label, "This is a text uncovered from right to left a bit faster!", 35, 1)
Sleep(1500)
_txt_eff__move_in_from_left ($guiwin, $input, "This is a text which comes from left and goes back to left.", 50)
Sleep(500)
_txt_eff__move_out_to_left ($guiwin, $input, "This is a text which comes from left and goes back to left.", 50)
Sleep(1500)
_txt_eff__move_in_from_right ($guiwin, $input, "This is a text which comes from right and goes back to right.", 50)
Sleep(500)
_txt_eff__move_out_to_right ($guiwin, $input, "This is a text which comes from right and goes back to right.", 50)
Sleep(1500)
_txt_eff__show_text_behind_char ($guiwin, $label, "An imaginary password", 150, "*")
Sleep(1500)
_txt_eff__move_string_through_text ($guiwin, $input, "Text for testing purpose.", 75, "<|>")
Sleep(500)
_txt_eff__move_string_through_text ($guiwin, $input, "Second text for testing purpose.", 75, "_")
Sleep(1500)
_txt_eff__airport ($guiwin, $label, "TRAIN 153 LEAVES 15 MINUTES LATER!", 1, " ", 3)
Sleep(1500)
_txt_eff__move_in_from_left ($guiwin, $input, "Enjoy this UDF by peethebee, 2005!", 35)
Sleep(1500)
_txt_eff__spin ($guiwin, $input, "Enjoy this UDF by peethebee, 2005!", 55)
Sleep(1500)
_txt_eff__broad ($guiwin, $label, "It's rocking! ;-)", 50, " ", 1, 1000)
Sleep(1500)
ControlSetText($GUIwin, "", $input, "--------------------------------------------")
Sleep(1500)
_txt_eff__raining ($guiwin, $input, "Attention! Letters falling down!", 25, 5000, 1)
Sleep(1500)
_txt_eff__about_messages ($guiwin, $label, $credits, 15, $times, 1, "right_to_left") ; "raining", "right_to_left", "left_to_right", "right_to_right", "left_to_left", "enlarge_left", "enlarge_right"
Sleep(1500)
_txt_eff__move_cap_char_through_text($guiwin, $input, "This is a text where a capital letter scrolls through!", 50, 1, "to_right", 0)
Sleep(1500)
_txt_eff__move_small_char_through_text($guiwin, $input, "IMPORTANT INformatION!", 75, 1, "to_left", 1)
Sleep(1500)
_txt_eff__scroll_through_options($guiwin, $label, $options, "Option 4", 750)
Sleep(1500)
_txt_eff__uncover_from_wall_to_wall($guiwin, $input, "This text is uncovered in an unconventional way", 50, 3)
Sleep(1500)
_txt_eff__wave($guiwin, $label, "LaOla is running through the stadium!", 50, 3, 1, "to_right")
Sleep(1500)
_txt_eff__blink($guiwin, $label, "Las Vegas Casino", 250, 150, "parts", $parts, 5)
Sleep(1500)
_txt_eff__rainbow($guiwin, $input, "This is the next type of animation. COLORS!", 250, 100, 1)
Sleep(1500)
_txt_eff__rainbow($guiwin, $label, "This is the next type of animation. COLORS!", 750, 100)
Sleep(1000)
_txt_eff__fade_in($guiwin, $label, "Again a test: Fading", 1000, 50, "win_xp_bg")
Sleep(1500)
_txt_eff__style($guiwin, $label, "", "bold", "Courier New", 1, 2500)
Sleep(1500)
_txt_eff__fade_out($guiwin, $label, "Again a test: Fading", 1000, 50, "win_xp_bg")	
Sleep(1500)
_txt_eff__mix_up_chars($guiwin, $input, "This Is The END.", 125, 1, "to_right")
Sleep(1500)
_txt_eff__spotlight($guiwin, $input, "The real END!", 250, 1, "(", ")", 0, "to_right")
Sleep(1500)
_txt_eff__about_messages ($guiwin, $label, $about, 5, $times, 1, "modern") ; "raining", "right_to_left", "left_to_right", "right_to_right", "left_to_left", "enlarge_left", "enlarge_right", "modern"
Sleep(2000)

Exit


Func Quit()
	Exit
EndFunc

Скриншот Text Effects Disigner:


Файл: Текстовые эффекты

Источник: Text Effects UDF
Автор(ы): Peethebee
 

neobi

Новичок
Сообщения
25
Репутация
1
А можно ли ч помощью этой библиотеки Поменять ореентацию текса с горизонтальной на вертикальную
 
Автор
Zaramot

Zaramot

I ♥ AutoIt
Сообщения
1,160
Репутация
660
Попробуй так:
Код:
$Text = 'Какой-то текст'
MsgBox(0, '', _VertText($Text))

Func _VertText($iText)
   Local $VertText
   $iSplit = StringSplit($iText, '')
   
   For $i = 1 To $iSplit[0]
      $VertText &= $iSplit[$i] & @CRLF
   Next

   Return $VertText
EndFunc
 

neobi

Новичок
Сообщения
25
Репутация
1
Так при этом будт буквы горизонтальные единственое что они будту расположенеы друг под дургом, а надобы как в Excel чтобы текст был повёрнут на 90 градусов

Я нащёт этого писал
 
Автор
Zaramot

Zaramot

I ♥ AutoIt
Сообщения
1,160
Репутация
660
В UDF такого нет....

Вот:
Код:
#include <WinApi.au3>
#include <StructureConstants.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate('Test', 500, 400)
GUISetState()

Do
	_DrawVertText($hGUI, 'Hello world', 150, 200, 100, 20, False, True, True, 'Colibri', $TRANSPARENT, 0x0, 90)
	_DrawVertText($hGUI, 'Hello world', 250, 300, 100, 20, True, True, False, 'Verdana', $TRANSPARENT, 0x00FF00, 180)
	_DrawVertText($hGUI, 'Hello world', 300, 300, 800, 35, True, False, False, 'Tahoma', $TRANSPARENT, 0xFF00FF)
	_DrawVertText($hGUI, 'Hello world', 350, 200, 100, 20, True, False, False, 'Arial', $TRANSPARENT, 0x00FF00, 120)
Until GUIGetMsg() = -3

;====================================================
;	$iGUI - окно в котором будет находится текст
;	$iText - сам текст
;	$iX - X позиция текста
;	$iY - Y позиция текста
;	$iBold - толшина текста
;	$iSize - размер текста
;	$iUnderline - зачеркнуть текст
;	$iStrikeOut - подчеркнуть текст
;	$iItalic - курсивный текст
;	$iFontName - название шрифта
;	$iBKColor - цвет фона текста
;	$iColor - цвет текста
;	$iRot - на сколько градусов повернуть текст
;====================================================
Func _DrawVertText($iGUI, $iText, $iX, $iY, $iBold, $iSize, $iUnderline = False, $iStrikeOut = False, $iItalic = False, $iFontName = 'Arial', $iBKColor = $TRANSPARENT, $iColor = 0x0, $iRot = 0)
    Local $hGUI, $tRect, $rotate, $RotateMe, $rFont, $hDC
    $tRect = DllStructCreate ($tagRECT)
    DllStructSetData ($tRect, 'Left', $iX)
    DllStructSetData ($tRect, 'Top', $iY)
    If Not $iRot = 0 Then $rotate = $iRot * 10
    $RotateMe = DllStructCreate ($tagLOGFONT)
    DllStructSetData ($RotateMe, 'Escapement', $rotate)
    DllStructSetData ($RotateMe, 'Height', $iSize)
    DllStructSetData ($RotateMe, 'Weight', $iBold)
    DllStructSetData ($RotateMe, 'Italic', $iItalic)
	DllStructSetData ($RotateMe, 'Underline', $iUnderline)
	DllStructSetData ($RotateMe, 'StrikeOut', $iStrikeOut)
    DllStructSetData ($RotateMe, 'FaceName', $iFontName)
    $rFont = _WinAPI_CreateFontIndirect ($RotateMe)
    $hDC = _WinAPI_GetDC ($iGUI)
    _WinAPI_SetTextColor ($hDC, $iColor)
	If $iBKColor = $TRANSPARENT Then _WinAPI_SetBkMode($hDC, $TRANSPARENT)
    _WinAPI_SetBkColor ($hDC, $iBKColor)
    _WinAPI_SelectObject ($hdc, $rFont)
    _WinAPI_DrawText ($hDC, $iText, $tRect, BitOR ($DT_NOCLIP,$DT_NOPREFIX))
    _WinAPI_ReleaseDC ($iGUI, $hDC)
EndFunc


PS Надеюсь разберешься :smile:
 

neobi

Новичок
Сообщения
25
Репутация
1
Zaramot спасибки огромное И попуто вопросик это будет работать в кнопках в группах и тд... ?
 
Верх