TheAppFoundry 11 Share Posted July 10, 2017 My script is lagging very bad. The onPaint is being called rapidly as I assume is normal. I'm just trying to draw a rectangle but it lags very badly. I put the main thread to sleep in the onstart to see if there was anything interfering and it still lags. Any ideas? @Override public void onPaint(Graphics graphics) { log("OnPaint Called"); graphics.drawRect(100,100,200,200); graphics.setColor(Color.CYAN); log("test after rect"); } @Override public void onStart() { try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } log("On Start Called"); Link to comment Share on other sites More sharing options...
Pandemic 2711 Share Posted July 10, 2017 I wouldn't log anything in onPaint, and we recommend you use our sleep method instead of Thread.sleep() Link to comment Share on other sites More sharing options...
distraction 61 Share Posted July 10, 2017 I had this same problem when I was working on my first paint. The problem was exactly what pandemic mentioned, the logs in the paint function. Link to comment Share on other sites More sharing options...
TheAppFoundry 11 Author Share Posted July 11, 2017 @pandemic, why y'alls threads over the normal java ones? If you don't mind me asking!I also didn't think logs were that intensive? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.