I’ve just pushed my latest code updates to my website. However, they didn’t look like they were the ones responsible for what you’re seeing, and when I run the code then I don’t get that behaviour. But I did get something like it - if I understand correctly what you mean. Check the function ColourWheel:draw()
in the Colour
tab. Does it have strokeWidth(.05)
about half way through? I think that that was one of the changes I had to make. If it doesn’t try updating again.
In the Colour Tab, it has strokeWidth(5). So I probably have the wrong Library. But now I’m thinking, maybe I have the wrong link. I’m using the link to the AESLibrary.zip file from your previous post: http://www.math.ntnu.no/~stacey/documents/Codea/AESLibrary.zip
When I looked in the zip again, it still has strokeWidth(5) under ColourWheel:draw().
@Ric_Esrey Ooops! Sorry. I forgot about the zip files. The most reliable source for my code is the BZR repositories which are based at http://www.math.ntnu.no/~stacey/code. However, I know that that’s not always the easiest way to get hold of Codea programs so I’ve updated the zip files. There’s also single-file projects which are suitable for cut-and-paste import. These have the same name as the zip file but with extension lua.
Okay, I have it now. I went to your BZR repository instead of the zip files. Of course, I couldn’t get it to work until after I had built your Cubic Shader (which is now part of your Library). But it’s all good. I wanted to learn more about shaders anyway–and you included a great explanation with your shader samples. Thanks @Andrew_Stacey!!!
@Ric_Esrey Whoops! Sorry again!
I have published my shaders, same BZR location, but I think that that’s older than the rest of the code as looking at the Cubic
shader in there then I don’t think it’s the right one. Anyway, I’m glad you finally got it all working.
Let me know what you think of it now.
@Andrew_Stacey… not a problem. You’re probably correct in that the Cubic shader may not be compatible with the Library. I can run and draw pictures with the Harmony program (even though it depends on the Library). Yet, if I run the Library by itself, it locks up Codea. The Development Environment’s ‘run’ arrow glows–as if it wants to start–but nothing happens after that. Also, I had to install your Colour [sic] Manipulation shader in order to add pictures to Harmony (I only mention it in case others want to play with the program). As a suggestion, you should consider adding the code for the shaders directly into the Library. That would help alleviate angst from beginners like me.
By the way, the flowline brush was a great addition. Nearly everything in this version of Harmony appears to run solidly and quickly—between 45 and 60 FPS on my iPad 2. I’m still playing around with it. I’ll let you know if I come across any stumbling blocks. Really, the best thing I like about Harmony is that it has many features seen in the big name drawing apps–yet I can also see how it works.
@Ric_Esrey I get that freeze too, but it’s fairly new. If I can’t track it down then I might split my library as it is getting rather large.
You’re right about packing the shader in the code. I’ve done that when posting little projects but forgot for the cubic shader.
Glad you like the flowlines. The original algorithm was due to someone else on this forum, and when I saw it I decided it just had to go in Harmony.
I have chosen this project to do the multiplayer part of 6Dimension games, it will be opensource too as your license reads.
How would you saveImage with setContext if the backingMode is RETAINED?
Hi @juaxix,
Sorry for the delay in replying, I nearly missed this one (remember to use the @ notation to ensure that I see stuff).
I’m not sure I understand your question. My version of Harmony doesn’t use the RETAINED backing mode. The original did, but once I wanted to do a bit more stuff with it (such as add a UI) then I took that out and rendered to an image instead.
The current version can be used as a module inside some larger project, and you can get the picture directly without too much hassle. I have a project that uses this for annotating a PDF. The API probably isn’t very neat, but it is certainly usable. I’ll dig out that annotation project and post it so that you can see how I use it.
(Incidentally, I don’t think that you have to opensource all of your project to use this, do you? My reading of the licence is that you need to include that licence with the code from Harmony, and my library stuff that it uses is almost all public domain. On the other hand, I would encourage you to make it open source as I’m a firm proponent of it, but I don’t think it is a requirement.)
Cool @Andrew_Stacey , I ended with this version, too slow:
https://gist.github.com/juaxix/6299080
I’m going to try this latest version of yours, but I would like to just use the same code without the UI to not overload the game…
@Andrew_Stacey, @Ric_Esrey, and @shrike. Seriously? You guys have literally spammed this thread with over 90 comments in about three hours.
Ok @Andrew_Stacey .
Well, I have tested the latest version, it is amazing, with all those features, but I just would like the old version in an image, I’m trying to figure out how you did it in this version to apply in the old version.
From Main ( https://github.com/Shrike78/HarmonyCodea ) with
myImage = image(WIDTH, HEIGHT)
setContext(myImage)
should be a good starting point?
or do I must go throught mesh rects and all that stuff?
@SkyTheCoder maybe it is because of the comment editing, sometimes it gets laggy when posting
@SkyTheCoder This is an old thread dating probably from before you joined this forum, so you won’t have read all the old comments and are seeing 90 “new” ones. But they are quite old if you look at the actual dates.
@juaxix I’ll post my code that uses this in another project. That’ll give you some idea of how to use it.
@Andrew_Stacey Sorry, missed that.
@Andrew_Stacey ok, that would be nice thanks!
Any chance on getting the libraries in a gist? Easier to get into codea without a computer.
@Briarfox It should all be “gisted”, thanks to your awesome code. I use @toadkick’s cmodule stuff to load the necessary library tabs. All of my gists are available at https://gist.github.com/loopspace
@juaxix My project that uses the Harmony code is proving a little problematic: it’s crashing Codea on my iPad. I don’t know why, but I did manage to get it to upload to github. It’s at https://gist.github.com/loopspace/6312719. Nonetheless, it provides an example of how to use Harmony in another project.
It starts at line 109 in Main.lua where I define canvas
as a Canvas
object from the Harmony code. Another important one is setActiveCanvas
at the end which switches the background image for the canvas so that it draws on the right image. That image is then what the drawing is saved to so can be used elsewhere in the code. Due to the way that Harmony works, if you’re going to do some drawing on it and then use the image, you need to do canvas:drawcanvas()
to ensure that all the drawing is rendered on to the image.
Thanks @Andrew_Stacey ,check if the crash has something to do with calls to sprite() where the image cant be found.
I’m going to check your code soon, thank you again