Jump to content

Request: Rotate images


Recommended Posts

The topic title is clear.

If you're bored, here's a story why...

This morning at school, a friend showed me a game he made.

Really interesting and great that you can create a working game by typing code.

Makes you wonder how many lines of code Doom III has.

Anyways, he told me he tried to create a Tetris game.

And he gave up because it's too hard and alot of work/code.

Then I thought: Great idea! A tetris clone!

So I started working on it.

1. I assigned HotKeys to the arrow keys.

2. I created a label control with a black background. It became the long bar.

3. using the arrow keys, I could move the label

4. Then I added checks so the label didn't move outside the window

5. I added another 'object'. A 2x2 square.

6. When an object hits the ground, another object should appear at the top

7. Two dilemmas: 1. I can't rotate the labels 2. I can't create the orginal Tetris objects using labels.

For 2nd dilemma, I made images.

(I think I'll make an array so I know when it's an image or label.)

Can you add the ability to rotate a control?

Edit:

Removed typos

Edited by SlimShady
Link to post
Share on other sites

I'm sure its possible by overriding the painting process, but I don't recall ever seeing a simple API call to change the orientation of a control. In short, I wouldn't count on seeing that as doing custom/special things with the painting is just a mess.

Link to post
Share on other sites

I'm sure its possible by overriding the painting process, but I don't recall ever seeing a simple API call to change the orientation of a control.  In short, I wouldn't count on seeing that as doing custom/special things with the painting is just a mess.

<{POST_SNAPBACK}>

You're talking with a call from DllCall? :)
Link to post
Share on other sites

I would use pictures and move the control when you want to rotate it update it with a new picture that has that orientation.

red

<{POST_SNAPBACK}>

I'm doing that now.

But I have a feeling that ControlGetPos caused a new problem.

The width of the control is incorrect.

I'm going to test a little to be sure.

Edit:

I forgot that $Pos[3] contains the height of the control instead of the width.

Edited by SlimShady
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...