1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved A word from particles

Discussion in 'Development' started by dirouc, Dec 19, 2017.

  1. dirouc

    dirouc Silverfish

    Messages:
    19
    GitHub:
    dirouc
    In what way is it better to compose a word from particles?
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    A better way compared to what? Also, this is the development section. Please show proof of a previous attempt.
     
  3. dirouc

    dirouc Silverfish

    Messages:
    19
    GitHub:
    dirouc
    What other attempt?
     
  4. dirouc

    dirouc Silverfish

    Messages:
    19
    GitHub:
    dirouc
    With nothing, i did not find any examples at all.
     
  5. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    How have you tried to do this so far?
     
    jasonwynn10 likes this.
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    idea, get a textfont file
    and read white as 1, black as 0
    each black will be a particle
    each white will be blank
     
    BEcraft, SleepSpace9, SOFe and 2 others like this.
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    If the words are provided by the player, perhaps you want to attach a font file with your plugin, include a font parser library and convert the fonts into a bitmap that you can place particle dots according to.
     
    Muqsit likes this.
  8. BEcraft

    BEcraft Slime

    Messages:
    79
    GitHub:
    BEcraft
    PHP:
    $level $this->getServer()->getDefaultLevel();
    $imagen = @imagecreatefrompng($file $this->getDataFolder()."your_image.png");
    $imagen imagecolorallocate($imagen255255255);
    imagestring($imagen500"Hi"imagecolorallocate($imagen00255));
    $imagen imagerotate($imagen, -1800);
    $size getimagesize($file);
    for(
    $x 0$x $size[0]; ++$x){
    for(
    $y 0$y $size[1]; ++$y){
    $color imagecolorsforindex($imagenimagecolorat($imagen$x$y));
    if(
    $color["red"] === 255 and $color["green"] === 255 and $color["blue"] === 255){ //optional xD
    continue;
    }
    $level->addParticle(new FlameParticle($level->getSafeSpawn()->add($x*0.15$y*0.15, -$x*0.15)));
    }
    }
    imagedestroy($imagen);
    Maybe this would be useful as a reference
     
    HimbeersaftLP, SOFe and jasonwynn10 like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.