[C#] RPG Editor Help

Started by G_G, August 14, 2010, 05:56:06 pm

Previous topic - Next topic

G_G

Basically I'm trying to create an RPG Editor for me and Munkey's engine made in XNA. And I started creating the user interface for the actors and thats when I got stumped here. Everything else for the actors is easy. I also might need help for other things as well. Anyways I'm gonna keep this topic for any help I need creating this editor.


Problem 1
Spoiler: ShowHide
I've messed around with Bitmaps a bit in c# but not a whole lot. First let me say that I'm trying to create something like in the RPGXP Database under actors, I want to be able to create those parameter stat editors. The MaxHP, SP, STR, etc.

I can do it if I know how to do this.
-When a picture box is clicked, I want the mouse position relative to the picture box, so if I click in the top left corner of a picture box, the position will be 0, 0
-Drawing a colored line on a bitmap, from top to bottom. The height being a percent from where the bitmap was clicked on. So if it was 0, 0, the height would be 100% and draw the line completely from top to bottom. Or if it was 0, 10, it'd be 90% and it'd draw the line from 0,10 to the bottom.
-Some sort of algorithm for the Generate a Curve button.




Blizzard

Use my Unlimited Levels for curve generation algorithms.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

with the draw thing, use the drawing to generates the stats, THEN uses the stats to draw the image
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

Well oddly enough when making an RMXP Sprite Animator I learned how to do everything I needed, except the mouse clicking part as in get the mouse coordinates relative to the control.

Ryex

can you get the mouse coordinates relative to the window? if so just use the position of the control
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

I was trying to find that as well. No luck yet, but google hates me so meh.

winkio

1.  Get mouse coordinates on screen
2.  Get window coordinates on screen
3.  Get picture coordinates on window
4.  Add window coordinates to picture coordinates to get picture coordinates on screen
5.  Compare

G_G

So this
Window X = 100
PicBox X = 10
Mouse X = 110 (clicked on left corner pixel)

Ah I see, Just subtract window position and picbox position from mouse position. Thanks winkio xD

Blizzard

Why don't you just use an OnClick event? Each control should be able to assign a callback function/method for mouse clicks.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Good point .-.
and I tried using one of your algorithms, apparently you cant do ** in c#. I dont even know what that does.

Blizzard

It's the power function.

x ** y in Ruby = Math.Pow(x, y) in C#
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Ah. Okay that helps thanks. For now resolved but I may have more questions later.

Blizzard

Sure thing, pretty girl. *points at your avatar* But you know it's gonna cost ya. This merchandise ain't for free, ya know. :V
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G