C# Class OhMyDanmaku.wpfDanmakulib

Exibir arquivo Open project: StoneMoe/OhMyDanmaku Class Usage Examples

Public Methods

Method Description
createDanmaku ( string _content, int _targetRow, int _rowHeight, int _fontSize, int _duration, byte _R, byte _G, byte _B, bool _enableShadow ) : void

Create a danmaku manually, instead of using default construct method params.

generateDanmaku ( string text ) : void

This is a completely automatic danmaku generater, create a danmaku in a random row slot with default construct method params. This method only available when APCS is enabled.

getNormalRowHeight ( ) : int

Returns normal row slot height, generated by row slot manage system

getRowNumbers ( ) : int

Returns total row slot numbers, generated by row slot manage system

wpfDanmakulib ( Canvas wpfCanvas, Random random = null, bool enableAPCS = true, initCompleteHandler final = null, int Duration = 9000, int FontSize = 30, bool Shadow = true, byte ColorR = 255, byte ColorG = 255, byte ColorB = 255 ) : System

wpfDanmakulib initialization Entry point

Private Methods

Method Description
calcRow ( double _renderHeight, string _testTargetName, double _fontHeight ) : void
doAnimation ( string _targetUniqueName, int _duration, int _row ) : void
getAvailableRow ( ) : int
getRandomString ( int _Length ) : string
libInit ( initCompleteHandler initCompleted ) : void
lockRow ( int _row ) : void
preventCoverInit ( initCompleteHandler initCompleted ) : void
removeOutdateDanmaku ( string _targetUniqueName, int _row ) : void
unlockRow ( int _row = -1 ) : void

Method Details

createDanmaku() public method

Create a danmaku manually, instead of using default construct method params.
public createDanmaku ( string _content, int _targetRow, int _rowHeight, int _fontSize, int _duration, byte _R, byte _G, byte _B, bool _enableShadow ) : void
_content string Danmaku Content
_targetRow int Target row slot, check "getRowNumbers" method
_rowHeight int Row slot height, check "getNormalRowHeight" method
_fontSize int Danmaku font size
_duration int Danmaku stay duration cross the render area
_R byte Danmaku color red
_G byte Danmaku color green
_B byte Danmaku color blue
_enableShadow bool Danmaku shadow
return void

generateDanmaku() public method

This is a completely automatic danmaku generater, create a danmaku in a random row slot with default construct method params. This method only available when APCS is enabled.
public generateDanmaku ( string text ) : void
text string Danmaku Content
return void

getNormalRowHeight() public method

Returns normal row slot height, generated by row slot manage system
public getNormalRowHeight ( ) : int
return int

getRowNumbers() public method

Returns total row slot numbers, generated by row slot manage system
public getRowNumbers ( ) : int
return int

wpfDanmakulib() public method

wpfDanmakulib initialization Entry point
public wpfDanmakulib ( Canvas wpfCanvas, Random random = null, bool enableAPCS = true, initCompleteHandler final = null, int Duration = 9000, int FontSize = 30, bool Shadow = true, byte ColorR = 255, byte ColorG = 255, byte ColorB = 255 ) : System
wpfCanvas Canvas A WPF Canvas for containing danmakus
random Random Use your own random seed or leave it null
enableAPCS bool APCS(Auto Prevent Cover System) is used for maintaining a row slot status list for solving danmaku occlusion issue. Disable APCS can save few system resource.
final initCompleteHandler Call a method when wpfDanmakulib initialization completed or leave it null
Duration int Danmaku stay duration (ms)
FontSize int Danmaku font size
Shadow bool Danmaku Shadow Effect visibility
ColorR byte Danmaku color red value (0-255)
ColorG byte Danmaku color green value (0-255)
ColorB byte Danmaku color blue value (0-255)
return System