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.