Forum

> > CS2D > Scripts > Custom Animated Image Functions
Forums overviewCS2D overview Scripts overviewLog in to reply

English Custom Animated Image Functions

2 replies
To the start Previous 1 Next To the start

old Custom Animated Image Functions

The Dark Shadow
User Off Offline

Quote
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!
edited 3×, last 29.04.20 12:29:22 am

old Re: Custom Animated Image Functions

Bowlinghead
User Off Offline

Quote
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.
More >


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

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.
edited 2×, last 29.04.20 07:36:02 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview