Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> How do I enter sprites into gamemaker code?, Game maker 7
United States
Yoshibro.
  Posted: Jun 18 2008, 12:51 AM
Quote Post


The adventures continue!
[*][*]

Group Icon
Group: Members
Posts: 237
Member No.: 4301
Joined: 24-August 07

Status: (0d) [--]


I need to know how do I enter things like objects or sprites into code.
Example:
cursor_sprite
How do I put eggroll sprite into this code correctly?

This post has been edited by Yoshibro. on Jun 18 2008, 12:53 AM


--------------------
user posted image user posted image
[URL=
Top
Unspecified
Mr.Cintrak
Posted: Jun 18 2008, 01:00 AM
Quote Post


No More.


Group Icon
Group: Members
Posts: 494
Member No.: 5413
Joined: 13-June 08

Status: (0d) [--]


Well you didn't supply much information on how you want to pull it off.
you could try using sprite_index to define the sprite, but still you haven't given much to work with.


--------------------
My Ryhmes Are No More I've changed for these times.Good By MC I am Only Cintrak Now.
Ref2,Courtesy of shymouse. Ref 3 Courtesy of Iceinwar


QUOTE (Boxxy)
i love how you are all **** WHERE IS MY MARIO ZELDA HYPER PIKMIN GAME when e3 comes along but when those kinds of games come out you just say THIS GAME IS **** DAMN THAT CONTROLLER LOOKS LIKE A DIL-DO
PM
Top
Unspecified
Miaxis
Posted: Jun 18 2008, 02:10 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


Two ways:
1.Hide the mouse cursor and draw the sprite at the mouse position.
2.cursor_sprite=(spriteindex)


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Japan
Soiyeruda
Posted: Jun 18 2008, 05:56 PM
Quote Post


Because retarded looking women is fun. :S
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3589
Member No.: 5004
Joined: 6-March 08

Status: (0d) [--]


From what I read, it seems you want to know how to place the name of the object/sprite into your code, correct?
If so, it's really simple

Let's pretend you have an item called objMario

if you want a variable (let's call it location) to have the value of said object, you do this:

CODE
location=objMario


If an object by the name "objMario" exists, the name should turn purple.

so if you want cursor_sprite to = eggroll sprite, you do

CODE
cursor_sprite=eggroll


As a warning, make sure NO TWO OBJECTS SHARE THE SAME NAME. If you do so, then you may get glitches.

For example, if you had an object and a sprite, and both were named Mario, and you decide to do:

CODE
cursor_sprite=Mario


This would most likely not work, since the object Mario isn't a sprite, and would therefore, cause an error.

In which case, it's best to put a small abbreviation in front of your names.
Here's a nice way to organize:
spr = sprite
obj = object
bck = background
snd = sound
pth = path
scr = script
rom = room
fnt = font
tml = timeline

Don't make them unnecessarily long. Up to 3 letters is good enough.
And so on. This way, you can have an sprMario and an objMario, with none of the errors.
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0485 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.26 ]