Android Open Source - candymem Asset Helper






From Project

Back to project page candymem.

License

The source code is released under:

GNU General Public License

If you think the Android project candymem listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package se.tube42.kidsmem.logic;
//w w w  .  j  a v  a  2 s  .com
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.*;

import se.tube42.kidsmem.data.*;
import se.tube42.kidsmem.service.*;
import se.tube42.kidsmem.item.*;


import static se.tube42.kidsmem.data.Assets.*;

public class AssetHelper
{

    public static void load()
    {
        String base = "1/";

        // fonts
        if(UI.dpi_class > 2) {
            font1 = ServiceProvider.loadFont(base + "font1x2");
            font1.setScale(0.5f);
        } else {
            font1 = ServiceProvider.loadFont(base + "font1");
        }

        // patches
        np_shadow = ServiceProvider.loadPatch(base + "shadow.9.png", 6, 5, 6, 5);
        np_botshadow = ServiceProvider.loadPatch(base + "botshadow.9.png", 7, 7, 1, 11);

        // Textures
        tex_candy2 = ServiceProvider.loadTexture(base + "candy2.png", true);

        tex_menu = ServiceProvider.loadTexture(base + "menu.png", true);
        tex_menu_shadow = ServiceProvider.loadTexture(base + "shadow.png", true);

        tex_candy1 = ServiceProvider.loadTexture(base + "candy1.png", true);
        tex_tiles = ServiceProvider.loadTexture(base + "tiles.png", true);

        // regions
        reg_candy2 = ServiceProvider.divideTexture(
                  tex_candy2, 256 / 6, 64);

        reg_menu = ServiceProvider.divideTexture(tex_menu, 128, 128);
        reg_menu_shadow = ServiceProvider.divideTexture(tex_menu_shadow, 128, 128);
        reg_candy1 = ServiceProvider.divideTexture(
                  tex_candy1, 102, 102);
        reg_tiles = ServiceProvider.divideTexture(
                  tex_tiles, 128, 128);

        Texture tmp = ServiceProvider.loadTexture(base + "rect.png", false);
        reg_rect = ServiceProvider.divideTexture( tmp, 8, 8);

        // particles
        pep_explode = ServiceProvider.loadParticle(base, "explode");
        pep_firework = ServiceProvider.loadParticle(base, "firework");
        pep_trail = ServiceProvider.loadParticle(base, "trail");

        // audio
        sound_yes = ServiceProvider.loadSoundArray("yes");
        sound_no  = ServiceProvider.loadSoundArray("no");
        sound_hit  = ServiceProvider.loadSoundArray("hit");
        sound_start = ServiceProvider.loadSound("start");
        sound_end = ServiceProvider.loadSound("end");
        talk_on = ServiceProvider.loadSound("talk_on");
        talk_off = ServiceProvider.loadSound("talk_off");
        talk_play = ServiceProvider.loadSound("talk_play");
        talk_hardness = ServiceProvider.loadSoundArray("talk_hardness");
    }
}




Java Source Code List

com.badlogic.gdx.backends.lwjgl.LwjglApplication.java
se.tube42.kidsmem.KidsMemoryApp.java
se.tube42.kidsmem.SystemHandler.java
se.tube42.kidsmem.android.MainActivity.java
se.tube42.kidsmem.data.Assets.java
se.tube42.kidsmem.data.Constants.java
se.tube42.kidsmem.data.Settings.java
se.tube42.kidsmem.data.UI.java
se.tube42.kidsmem.data.World.java
se.tube42.kidsmem.desktop.DesktopMain.java
se.tube42.kidsmem.item.Button.java
se.tube42.kidsmem.item.FireworkItem.java
se.tube42.kidsmem.item.GameStat.java
se.tube42.kidsmem.item.TileSprite.java
se.tube42.kidsmem.item.TopBar.java
se.tube42.kidsmem.logic.AssetHelper.java
se.tube42.kidsmem.logic.GameHelper.java
se.tube42.kidsmem.logic.SettingsHelper.java
se.tube42.kidsmem.logic.SizeHelper.java
se.tube42.kidsmem.scene.BackgroundScene.java
se.tube42.kidsmem.scene.GameScene.java
se.tube42.kidsmem.scene.MenuScene.java
se.tube42.kidsmem.service.ServiceProvider.java
se.tube42.lib.item.BaseItem.java
se.tube42.lib.item.BaseText.java
se.tube42.lib.item.ParticleItem.java
se.tube42.lib.item.PatchItem.java
se.tube42.lib.item.SpriteItem.java
se.tube42.lib.scene.LayerList.java
se.tube42.lib.scene.Layer.java
se.tube42.lib.scene.SceneManager.java
se.tube42.lib.scene.Scene.java
se.tube42.lib.service.AssetService.java
se.tube42.lib.service.JobService.java
se.tube42.lib.service.RandomService.java
se.tube42.lib.service.StorageService.java
se.tube42.lib.util.BaseApp.java
se.tube42.lib.util.UIC.java