Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do i import a sprite? what are libraries?
#1
i am new to NaaLaa and i dont really know how how to bring in my own sprites and what are libraries and how do they work?
Huh Huh
Reply
#2
the dude image will be store in slot number 1,

load image 1, "assets/dude.png"

so if you need to call it something more then just 1 then
IMAGE_DUDE 1
load image IMAGE_DUDE, "assets/dude.png"

This is how you import the librarys

import "Speed.lib"
import "Keycodes.lib"
Reply
#3
Sorry but what? what are libraries and what are they used for? is there a folder that i put sprites in or what?
Reply
#4
(01-17-2019, 02:45 AM)th3ch33z1t Wrote: Sorry but what? what are libraries and what are they used for? is there a folder that i put sprites in or what?

What are you trying to do?

If you need to load an image / sprite into your program you need to put the image in the same directory as your code, you don't need to import any lib for that, just use the code like:
Code:
load image 1, "assets/dude.png"


To load a library into your code you need to:
Code:
import "Speed.lib"
import "Keycodes.lib"

The speed lib is used to control the fps and the Keycodes contains the keys of the keyboard.

If you need some specific just put here what are you trying to do, like some written code and image or something else.

if you save your code like Documents/games, then your sprites should be in that directory.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)