Skip to content

Month: April 2009

Yume No Kakera

yume no kakera

Nos dias 17 e 18 de Abril das 9h as 17h com:

  • Exibição de animes,tokusatus, amv’s e j-clipes.
  • Oficinas: Desenho,Roteiro para Fanzine, Roteiro para Cinema, Fanzine e Origami.
  • RPG.
  • Apresentação de Artes Marciais.

Local: Casa Brasil Caucaia
Endereço: Rua Santa Marta, nº 35 (Em frente ao BPM da Polícia).
Maiores Informações: 3475 0833 (Falar com Kelly)

ENTRADA GRATUITA

Realização: Casa Brasil e Grupo Barazoku. Apoio: mangkáx³

My Free Charset version 3, one quadrillion of new chars

We Are Hiring

Tons of new chars. I’ll not release them individually anymore because now I’m using just one XCF multilayer Gimp file that permits create  of new char combinations, so I’ll be releasing this file instead.

gimp screenshot

Mathematically, let’s assume I have just one layer. This permits create just one character (the nude one), ok? Each new layer I create, earrings as example, permits me create all chars I have done before with and without those earrings. That’s 2 times what we had before. With N layers I can create 2n different chars (2n-1? No, a char made of no layers can be the invisible man:)). We have now about 50 layers so we can create more than one quadrillion different combinations of chars. :o

Here’s the XCF Gimp file, chars.xcf (430Kb). To open and edit it you need the Gimp editor (The GNU Image Manipulation Program, download it here).

It’s also easier for you create your owns characters (try create yourself) or add hats, accessories, cloths, etc. Our My next step is write it to be programmability done with the same idea.

JavaFX, Acessando Recursos de Dentro do JAR

us flagTranslation: there’s a English version of this article.

Para algumas classes como o javafx.scene.image.Image é fácil abrir imagens de uma localidade remotada com:

ImageView {
    image: Image {
        url: "http://example.com/minhaFigura.png"
    }
}

ou uma imagem local com a constante __DIR:

ImageView {
    image: Image {
        url: "{__DIR__}/minhaFigura.png"
    }
}

Mas para outras classes abrir recursos internos (de dentro do próprio arquivo jar) não é tão direto. Por exemplo, no artigo Parsing a XML Sandwich with JavaFX eu tive que colocar o arquvio XML dentro de um diretório temporário. Uma maneira mais elegante teria sido:

package handlexml;

import java.io.FileInputStream;
import javafx.data.pull.*;
import javafx.ext.swing.*;
import javafx.scene.Scene;
import javafx.stage.Stage;

class Resource{
    function getUrl(name:String){
        return this.getClass().getResource(name);
    }

    function getStream(name:String){
        return this.getClass().getResourceAsStream(name);
    }
}

var list = SwingList { width: 600, height: 300}

var myparser = PullParser {
    documentType: PullParser.XML;
    onEvent: function (e: Event) {
        var item = SwingListItem {text: "event {e}"};
        insert item into list.items;
    }
    input: Resource{}.getStream("my.xml");
}
myparser.parse();

Stage {
    title: "Map"
    scene: Scene {
        content: list
    }
}

Com um simples arquivo XML chamadovmy.xml dentro do seu pacote.



   
   
   
   
   

fileplace

E temos os mesmos resultados de antes, mas com todos seus aquivos dentro de seus Jars.

Referencias:

JavaFX, getting resources of inside your JAR

br flagTradução: há uma versão em Português desse artigo.

For some classes like javafx.scene.image.Image is easy load an image from a external resource like:

ImageView {
    image: Image {
        url: "http://example.com/myPicture.png"
    }
}

or a resource inside your own Jar file with the __DIR__ constant:

ImageView {
    image: Image {
        url: "{__DIR__}/myPicture.png"
    }
}

But for other classes loading a internal resource (inside your own jarfile) is not so direct. For example, in the article Parsing a XML Sandwich with JavaFX I had to place the XML file in a temp directory. A more elegant way would be:

package handlexml;

import java.io.FileInputStream;
import javafx.data.pull.*;
import javafx.ext.swing.*;
import javafx.scene.Scene;
import javafx.stage.Stage;

class Resource{
    function getUrl(name:String){
        return this.getClass().getResource(name);
    }

    function getStream(name:String){
        return this.getClass().getResourceAsStream(name);
    }
}

var list = SwingList { width: 600, height: 300}

var myparser = PullParser {
    documentType: PullParser.XML;
    onEvent: function (e: Event) {
        var item = SwingListItem {text: "event {e}"};
        insert item into list.items;
    }
    input: Resource{}.getStream("my.xml");
}
myparser.parse();

Stage {
    title: "Map"
    scene: Scene {
        content: list
    }
}

With a simple XML file called my.xml inside your package.



   
   
   
   
   

fileplace

And we get the same result as before, but all files inside our Jars.

References:

My Free Tileset, version 9

More scenes and tiles for the free and open pixelart tileset. Also new monsters and characters but these will be showed in more details in another post.

Scientists discovery that they can’t keep a Gjelly (one of the new monsters) in cages.

lab incident

And also a little medieval scene. A naive princess got a Nhamnham monster as her pet.

cena princessa nhamnham

A new village scene, now with a pier, water, fence and new chars.

cena pier pixelart

There’s a plenty of new tiles. Now that we have a good basic tiles becomes easy to add more tiles.

free_tileset_version_9

Casa com os tiles livres

O Diogo_RBG, de Tocantins,  me enviou esse mapa que ele fez usando o conjunto de tiles que eu tenho postado regularmente no blog.

É uma bela casa, dois quartos, sala de estar, dois banheiros e sala de jantar conjugada com cozinha. :)

mapa do diogo

Aqui é ele em ação, funcionando, dentro da engine do The Mana World!

TMW

Eu aproveito pra divulgar o evento que ele participará falando de SDL, desenvolvimento de jogos e também mostrará esses tiles.

EDJA

Visitem também o blog dele e confiram seus excelentes tutoriais de como criar um MMORPG.