JubeatPlus 3.9.11
Loading...
Searching...
No Matches
EffectBgKnit Class Reference

A single animated decoration on the knit background. More...

#include <EffectBgKnit.h>

Inheritance diagram for EffectBgKnit:
Collaboration diagram for EffectBgKnit:

Instance Methods

(void) - init:effType:startPos:wmin:wmax:move:
 Sets the sprite up.
(float) - expand:totalFrame:max:
 A triangle wave over the effect's own cycle.
(BOOL) - renderEffect
 Advances the animation by one frame and draws it.

Detailed Description

A single animated decoration on the knit background.

One instance runs one effect of one type for a fixed number of frames and then reports that it is finished. The class declares no properties; its nine ivars carry the sprite's texture, position, frame counter and per-type width limits.

Method Documentation

◆ expand:totalFrame:max:

- (float) expand: (int) frame
totalFrame: (int) totalFrame
max: (float) max 

A triangle wave over the effect's own cycle.

Ramps from zero to max across the first half of totalFrame and back down across the second, so the value peaks at the midpoint. Single precision throughout — the metadata encodes both the argument and the return as f, not d.

Parameters
frameThe current frame. Taken modulo totalFrame, so it may run past it.
totalFrameThe cycle's length.
maxThe value at the midpoint.
Returns
The interpolated value.
Ghidra address:
0x194fb0
Ghidra address:
0x194fb0

◆ init:effType:startPos:wmin:wmax:move:

- (void) init: (nullable Texture2D *) texture
effType: (int) effType
startPos: (CGPoint) startPos
wmin: (int) wmin
wmax: (int) wmax
move: (int) move 

Sets the sprite up.

Returns void, not an object, despite the name.

The metadata encodes it v56@0:8@16i24{CGPoint=dd}28i44i48i52 and it never chains to an initialiser. The frame counter starts at zero and the duration is chosen from the effect type: ten frames for type zero and a hundred and twenty for every other.

Note that width_ is the one ivar this does not set.

Parameters
textureThe sprite's texture. Stored strongly.
effTypeWhich of the six effects to run.
startPosWhere to draw it.
wminThe narrowest width the effect uses.
wmaxThe widest width the effect uses.
moveHow far the effect travels.
Ghidra address:
0x194ff4

◆ renderEffect

- (BOOL) renderEffect

Advances the animation by one frame and draws it.

Dispatches six ways on the effect type. Returns YES once the frame counter has reached the effect's duration, so a caller can drop the sprite. A type outside the six draws nothing but still ages, so it retires on schedule.

Ghidra address:
0x1950c0
Ghidra address:
0x1950c0

The documentation for this class was generated from the following files: