Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - zacho

Pages: [1]
This error happens if you copy the "Images" folder into your instead of "Assets"

Problem solved  :P

How Do I...? / How to send an email with a file attachment?
« on: July 19, 2012, 10:10:04 am »
It has been written in here

but not answered as to how to send an attachment through an email. Using the below code I am able to fill in the email address and subject fields, but am unable to send an attachment:

Code: [Select]");

From where does the attachment url originate? is it from Assets? or from Documents? Can anyone shed light on this mystery? :)

Non-Game Programming / TouchAdd callback...
« on: July 13, 2012, 10:12:42 pm »
Is the callback only valid as the touch is being completed? ie. if a touch within an area is meant to change a variable, is the variable changed as the area is touched, then changes back as the area is released?

How Do I...? / FileSeek() + FileRead() questions
« on: July 09, 2012, 10:26:50 pm »
Hello again, I'm still wrapping my head around these character arrays but I have a question about these two file functions.

FileSeek() - this takes two arguments, the file handle and seek. The file handle is the same handle that is used for FileOpen but how is "seek" defined? Is seek defined as an index within the file? If I had a dictionary program with the words saved in a .txt file, how do I use "seek" to find a word (I use \n ) ?

FileRead() - this one takes three arguments. The handle makes sense but I have questions about the character array and length. When FileRead() is called, it starts at the index (seek? - see above) and will continue to read character by character as defined by len? After the data has been copied, it is transferred to a character array as defined as the second argument of the function?

Can anyone who knows about these functions share some light on how they actually work :/

Get your feet wet into DragonFireSDK and learn the basics (Guide)

Hello. Zacho here. After receiving wonderful and insightful help from the members of this forum, I have been inspired to help others as they have helped me. This thread will be where I will update tidbits of code to accomplish tasks using DragonFireSDK once I have learned the tricks. Most importantly... this thread will be a


in that everyone can contribute code and examples to share with each other. If you have a good example that you found yourself appraising please post it here so our knowledge of DragonFireSDK can continue to grow. Please post code using [ code ] [/ code ] tags.

Topics in thread
  • Creating a push button

To create a button, you must have two things; a function that is called when this button is pressed and two separate images for this button. The two images must have the same name and end with a 1 and a 2.
Button1.png       -       Button2.png
The function can look like something below (feel free to copy the code).

Code: [Select]
int OnButton(int id)
        //do something...
        return 0;

//ButtonAdd("filename", x-cor, y-cor, function, id#)
ButtonAdd("Images/Button", 0, 0, OnButton, 0);

The paramater "id" can be thought of as a case. For example, if three copies of this button were made right next to each other, so that three buttons sat side-by-side onscreen, the id would do something separate for each button. If the far-leftmost button was hit, the id called might be 1. The middle button's id might be 2 and the far-rightmost button's id might be 3.

Code: [Select]
int OnButton(int id)
        if( id == 1 )
        //do something...

        if( id == 2 )
        //do something...

        if( id == 3 )
        //do something
        return 0;

ButtonAdd("Images/Button", 0, 0, OnButton, 1);
ButtonAdd("Images/Button", 50, 0, OnButton, 2);
ButtonAdd("Images/Button", 100, 0, OnButton 3);
  • Flipping "pages"

I would like to do something like this:

MyFont = FontAdd("Helvetica", "Regular", 24, 0x00FF00);

int text;
string a = "WOAH";

text = TextAdd(10, 280, a, MyFont);

I am unfamilair with pointers (*) so this char cast the function does might give me an answer I not yet know how to solve. Many thanks :)

How Do I...? / Global variables within callback function?
« on: July 05, 2012, 09:44:41 pm »
This seems like a silly question, but within functions such as

int ButtonAdd(int cn,char *filename, int x, int y, int (*callback)(int id), int id);

can I manipulate variables for use within my whole program without using "Global"? These functions act as other functions and variables manipulated within them will dissapear as the function ends, correct?

Pages: [1]