Welcome, Guest. Please login or register. Did you miss your activation email?

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.


Messages - joelcnz

Pages: [1] 2
1
D / Re: Rotate with a set pivot point, and get rotation
« on: February 08, 2016, 08:00:43 am »
Thanks Hapax.  :) I should've known the rotation thing.

2
D / Re: Rotate with a set pivot point, and get rotation
« on: February 02, 2016, 07:35:55 am »
Thanks for the help with sprite origin for rotating.

These 2 below don't work for me (using D):
rotate(10);
sprite.setRotation(sprite.getRotation() + 90);

sprite.rotation(90); works instead of sprite.setRotation(90); for me.

3
D / Rotate with a set pivot point, and get rotation
« on: February 02, 2016, 05:48:26 am »
SFML doesn't seem to have a pivot setting. I want to rotate a sprite from its centre.

Also, how do you do relative rotation on a sprite? Only one kind of rotation works - object.rotation(90);.

4
D / Re: Drawing text to a Image object
« on: November 19, 2015, 03:09:34 am »
I still haven't gotten my calendar to save as a picture file.  :( I've got bitmaps working.

http://dpaste.dzfl.pl/a1d1c54f019c (I cleaned out the code comments).

5
D / Re: Drawing text to a Image object
« on: September 11, 2015, 07:03:29 am »
I did a print out with the day images only. I then got a pen out and wrote in the missing text.

6
D / Re: Drawing text to a Image object
« on: September 11, 2015, 12:51:51 am »
I print out the calenders, so I want hi res pictures.

7
D / Re: Drawing text to a Image object
« on: September 10, 2015, 09:51:51 am »
Thanks Jesper Juhl. But still don't know how to save RenderTexture objects to disc.

8
I want to do a calander. It takes a loaded picture for each day. And text like the days of the week and day numbers etc.

I can’t see how I can get a loaded image file to go onto a RenderTexture.

   auto renderTexture = new RenderTexture;
   renderTexture.create(4010, 2835);

   auto g_font = new Font;
   g_font.loadFromFile("DejaVuSans.ttf");

   auto txt = new Text("Test 1.2.3.", g_font, 30);
   txt.setColor( Color.Green );
   txt.position(Vector2f(10, 60));
   
   renderTexture.draw(txt);
   
   auto capturedTexture = renderTexture.getTexture;
   auto toSave = capturedTexture.copyToImage;
   
   if (!toSave.saveToFile("output.png"))
       return -1;

source/app.d(14): Error: mutable method dsfml.graphics.texture.Texture.copyToImage is not callable using a const object
FAIL .dub/build/application-debug-posix.osx-x86_64-dmd_2068-CD798876B80E564B1F2D02B479176F6C/ template-dfsml executable
Error executing command run: dmd failed with exit code 1.

9
D / Re: Tiled screens
« on: September 10, 2015, 05:41:47 am »
I've fixed the problem. Used tracers to help, eg. writeln(value);

10
D / Re: Tiled screens
« on: September 10, 2015, 04:20:07 am »
It just prints one kind of sprite, all bricks. It’s one file about 130 lines, maybe I can paste it in. It uses textureRect and IntRect.

11
D / Tiled screens
« on: September 10, 2015, 02:58:54 am »
I can't see what's wrong with this OSX program. It's a testing program.

Here's the program:
https://www.dropbox.com/s/6u98gcaoit5ac5j/Sprites.zip?dl=0

12
D / Re: Drawing text to a Image object
« on: September 09, 2015, 10:15:30 am »
I'm having trouble trying to work this out.  ??? Could I have an example?

13
D / Drawing text to a Image object
« on: September 09, 2015, 09:51:46 am »
Is it possible to draw text onto a image object? I've made a DSFML version of a chart from an Allegro 5.0 library.

14
D / Re: Text width, and sound
« on: August 27, 2015, 09:39:42 am »
I'm using SFML 2.0 (going by the dynamic link files).

I got sound working! I added a import (import dsfml.audio) and added a dependency in the dub.json ("dsfml:audio": "~master").

I get this with the programs that work:
Joels-MacBook-Pro:AudioTest joelcnz$ dub
WARNING: A deprecated branch based version specification is used for the dependency dsfml:audio. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
WARNING: A deprecated branch based version specification is used for the dependency dsfml:graphics. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Target dsfml:system ~master is up to date. Use --force to rebuild.
Building dsfml:audio ~master configuration "library", build type debug.
Running dmd...
Target dsfml:window ~master is up to date. Use --force to rebuild.
Target dsfml:graphics ~master is up to date. Use --force to rebuild.
Building dsfml-audio ~master configuration "application", build type debug.
Compiling using dmd...
Linking...
Running ./dsfml-audio

15
D / Re: Text width, and sound
« on: August 27, 2015, 03:13:12 am »
Thanks for the replies.

I've gotten the object width et. working, thanks Hapax;

I mean to reply later, Jesper Juhl, thanks.

Pages: [1] 2
anything