MV Common Plugin Struct

Discussion in 'Learning Javascript' started by nio kasgami, Jun 11, 2017.

  1. nio kasgami

    nio kasgami VampCat Veteran

    Messages:
    8,590
    Likes Received:
    2,340
    Location:
    Canada / Quebec
    First Language:
    French
    Introduction
    This thread have for unique purpose to share "common" reusable struct for MV new Plugin Manager.
    The idea behind is for the struct that can be used in multiple context. (e.g music, filename etc)

    Code:
    /// Will reproduce the Audio file structure making it easy to fetch for use with MV Audio system.
    
    /*~struct~IAudioStruct:
     * @param filename
     * @type file
     * @dir audio/
     *
     * @param volume
     * @type number
     * @default 90
     * @min 0
     * @max 100
     *
     * @param pitch
     * @type number
     * @default 100
     * @min 10
     * @max 150
     *
     * @param pan
     * @type number
     * @decimals 2
     * @default 0.5
     * @min 0
     * @max 1
     */

    Code:
    /// Will produce an structure for good control of basic Sprite manipulations.
    
    /*~struct~IFileImg:
     * @param filename
     * @desc The image filename.
     * @type file
     * @dir img/
     *
     * @param x
     * @desc The image X-axis.
     * @type number
     * @default 0
     *
     * @param y
     * @desc The image Y-axis.
     * @type number
     * @default 0
     *
     * @param anchorX
     * @text anchor X
     * @desc The X-axis anchor.
     * @type number
     * @decimals 2
     * @default 0.5
     * @min 0
     * @max 1
     *
     * @param anchorY
     * @text anchor Y
     * @desc The Y-axis anchor.
     * @type number
     * @decimals 2
     * @default 0.5
     * @min 0
     * @max 1
     *
     * @param hue
     * @desc The image hue.
     * @type number
     * @default 0
     *

    For that it's all I have think you are free to share more idea for structure.
     
    Last edited: Jun 12, 2017
    #1
    Shugo and waynee95 like this.
  2. orzfly

    orzfly Developer Developer

    Messages:
    18
    Likes Received:
    73
    Location:
    Shanghai, China
    First Language:
    Chinese
    Primarily Uses:
    RMMV
    You should use
    Code:
    @type number
    @decimals 2
    instead of
    Code:
    @type decimals 2
    By the way, don't forget the colon after the struct name:

    /*~struct~IFileImg:
     
    #2
    Shugo and nio kasgami like this.
  3. nio kasgami

    nio kasgami VampCat Veteran

    Messages:
    8,590
    Likes Received:
    2,340
    Location:
    Canada / Quebec
    First Language:
    French
    here u go fixed!
     
    #3

Share This Page