Forum

> > CS2D > Scripts > Custom Animated Image Functions
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Custom Animated Image Functions

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Custom Animated Image Functions

The Dark Shadow
User Off Offline

Zitieren
Read the title to know what I'm talking about, Can anyone fill those blanks for me, please. It will be the first OOP script in my project

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Animated = { Image = {} }

function Animated.Image:Create()

end

function Animated.Image:Destroy()

end

function Animated.Image:SetScale()

end

function Animated.Image:SetColor()

end

function Animated.Image:SetAlpha()

end

function Animated.Image:SetBlend()

end

function Animated.Image:SetPosition()

end

function Animated.Image:SetRotation()

end

function Animated.Image:SetMode()

end

Only filling the first three functions would be enough to I understand, So I can fill them by myself then.

Would be appreciated, Thanks!
3× editiert, zuletzt 29.04.20 00:29:22

alt Re: Custom Animated Image Functions

Bowlinghead
User Off Offline

Zitieren
I aint pro but I know this is running.
I didnt understand your . and : syntax. Like "Animated" is just a namespace for only the "Image" class. But whatever you should get my point.
Mehr >


What is the difference between . and : ?
Well every function using : can be expressed as a . function like so:
Mehr >

Using a : function will parse its own instance to the function internally which is called "self". Therefore you cannot SetAlpha without knowing your newly created variable.
Therefore make sure what you are about to do.
Always use "self" - using Animated instead results into unexpected behaviour.
2× editiert, zuletzt 29.04.20 19:36:02
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht