nerobot

Forum Replies Created

Viewing 15 posts - 256 through 270 (of 805 total)
  • Author
    Posts
  • in reply to: Image with texture mask #11272

    nerobot
    Participant

    But in your first example – maybe I’m wrong – it seems to tell to compiler
    Class Image has ‘new’ function added now..

    Not quite. Extension members are translated into global functions but allow us to use ‘dot’ to get access to them.

    Quick question: you could use Class Image Extension many times or there’s a limit to use it ONCE, for all the ‘new features’?

    Many times, in different files.

    More info:

    http://monkeycoder.co.nz/forums/topic/possible-to-add-method-to-rect-with-extention/

    http://monkeycoder.co.nz/forums/topic/class-extensions/

    Let’s continue discussion in topics above. 🙂

    in reply to: Image with texture mask #11264

    nerobot
    Participant

    There is an updated code for MaskedImage:

    Full code is here: https://www.dropbox.com/s/x7uvftczs7ie9pg/masked-image2.zip?dl=0

    Attachments:
    in reply to: Image with texture mask #11262

    nerobot
    Participant

     but no the ‘Extension’ thing (seems quite clear what it does… but I would know better!)

    Extensions are awesome part of language! 🙂

    It’s very useful to everybody learn it.

    You can open monkey2 folder as a project in Ted2Go and right-click on the root and choose Find..., then find by Extension keyword. And see what monkey2 already have.

    Class SomeClassName Extension is familiar for me, but I found something new:

    It looks like a magic. 🙂

    PS. I was surprised c# does not support operators overloading via extensions but monkey2 do that !

    in reply to: Image with texture mask #11248

    nerobot
    Participant

    Since Image.Shader property became writable, we can create Class MaskedImage extends Image with Property Mask:Image and change mask on-the-fly. 😉

    in reply to: Annotations (via comments) #11244

    nerobot
    Participant

    Never really used annotations, are they a bit like compiler warnings in c/c++? I have never been a huge fan of warnings in c/c++.

    There are annotation processors for processing annotation – we can add our processers for our custom annotation.

    Processors are based on reflection and can inspect our annotated code parts – and generate new code if necessary.

    Result compilation start after preprocessing to compile all that stuff.

    Huge article for Java: http://hannesdorfmann.com/annotation-processing/annotationprocessing101

    I have seen @override used in java I think. Why is it optional? Because it would break too much existing code? What does it actually do then?

    It’s a helper annotation which check “have superclass/interface this annotated member or not”.

    If you remove some methods from interface

    • w/o @override – removed methods stay as a own class methods, stopped overriding and don’t accessible via interface, but you have no notified about any problems here
    • with @override – compiler stopped and say “you have no such interface method”, so you don’t break your expected logic.

    And why not add @nulable as a language keyword?

    There are many other annotation which processed the same way, so is better to use Processors and don’t clutter the language itself.

    Annotations can have params – therefore they have more power than keywords.

    As you may have guessed, I’m not really into just throwing every possible consteuct at the language (simple as possible, no simpler etc) ala c#, and it’d be nice to have some ‘examples’ of why this is useful too?

    I agree with that.

    Main barrier here is how to processing annotations in monkey – processors should be usual monkey classes, I don’t know is it possible to run them and pass all annotated items..

    There are can be json’s annotations as a real example:

    @JsonName("personName") – allow us rename variable name and always have it as personName – don’t break deserialize process.

    @JsonIgnore allow to skip any fields by serializer

     

    All this stuff is looks hard to implement and have a phantom benefit, at least this time. 🙂

    in reply to: Ted2Go IDE #11206

    nerobot
    Participant

    Greetings from Russia. 😉

    I like that too. Maybe can add soon.

    (I already done with that in jentos.code – IDE for monkey-x.)

    in reply to: Component system for Mojo3D #11170

    nerobot
    Participant

    Wow! I like it.

    To construct generic-like system we already have minimal ‘reflection w/o reflection’ via typeName:

    Code for Map’s fans as me 🙂

    I like this generic way because

    • you can’t compile if did mistake
    • avoid to use ComponentType (at least for a first look) (with moving priority + unique properties into component class)

     

    Maybe ‘Unique’ might be a better name for this to prevent confusion?

    +1.

    Also Enabled propertywould be useful.

    in reply to: Diddy2 #11143

    nerobot
    Participant
    in reply to: Worried #11139

    nerobot
    Participant

    I also like monkey2 (and b3d & bmax) and try to do it better working on IDE.

    Earlier I chosen the QT Creator for desktop tools, but this time I prefer monkey2!

    And I’m waiting for v1.1.08. 🙂

    in reply to: Component system for Mojo3D #11138

    nerobot
    Participant

    Great work! Subscribed. 🙂

    in reply to: Ted2Go IDE #11134

    nerobot
    Participant

    Yay! I rewrite Project tree while fixing files filtering logic. Now it should work properly.

    What’s new in dev branch:

    • Project (Explorer) tree:
      • Added – storing/restoring of expanded items, and selected item – you will see tree state on start app the same as when closed it;
      • Fixed – expanding behaviour for double-clicks (also have-no-icons bug fixed);
      • Fixed – files filtering – read more here;
      • Added – option “Project tree single-click mode” into ‘Prefs — Common’ (False by default).
    • Fixed – crash using backspace at the end of file;
    • Fixed – IntelliSense + Zoom out #2;
    • Improved – correct “Find results” when remove / add lines in document;
    • Fixed – broken Ins/Ovr shitching by Ins key;
    • Fixed – capitalizing when press space / tab;
    • Improved – Source tree expanding state (was collapsed after parsing);
    • Improved – jump to find result – made centered line with result;
    • Added – Simple_Mojo3d_app template into ‘File — Templates’ (it’s bloom test file).

    It’s still v2.7. Please, test it. 🙂

    If all is OK I want to merge it into master.

    in reply to: Ted2Go IDE #11082

    nerobot
    Participant

    Does anyone else experience the IDE throttling CPU? Right now it’s at 98% CPU on my MacBook Air early-2014, and it regularly idles around 15% CPU on my desktop Windows 10.

    I hope with v1.1.08 compiler things will became better.

    Could it read my .gitignore file instead, because it already selects almost the same files?

    Maybe in a future, when regex will be a core part of monkey2.

    Behavior is kinda random… sometimes the filter is not applied until I switch away from ted2Go, then back. Sometimes the filter is applied when alt+tab switching, but all files under subfolders disappear.

    Just collapse then expand root project node should adjust filtering.

    Another problem to be fixed here – I’m using App.Idle to process tree, but it works only when there are sdl events, else it’s waiting for any event and then call Idle().

    I’m also confused with the explanation for the use of *. You say that *filter checks for text that starts with filter, but your example project.json file has the string *.products, which doesn’t seem to work. Shouldn’t it be .products* if you want to check for strings that end with .products?

    You are right, thanks!

    Think you’ve got startswith/endswith mixed up wrt: the ‘*’ filter.

    Probably yes. Will fix.

    Also, just added a tiny regex module called tinyregex to develop branch if that’s useful.

    Nice!

    Regex’s aren’t quite like yer standard file filters though, think I prefer plain file filters. Maybe * in filter could be replaced with .* or something before being regexed?

    Don’t know yet. 🙂

    in reply to: Ted2Go IDE #11069

    nerobot
    Participant

    I’m interested in is there someone who use project folder filtering via project.json ?

    • This file should be placed in project folder root.
    • Supported only “exclude” parameter yet.

    Project filter was introduced 4th december.. 🙂

    http://monkeycoder.co.nz/forums/topic/ted2go-fork/page/6/#post-5582

    There is my project.json file for Ted2Go:

    There is no regexp, but a little magic with * char:

    • *filter (starts with star) – check text.StartsWith( filter );
    • filter* (ends with star) – check text.EndsWith( filter );
    • *filter* (starts and ends) – check text.Find( filter );
    • filter (w/o stars) – check equals, text = filter.
    in reply to: (vote) varargs / params feature #11066

    nerobot
    Participant

    Usecase: c#-like string.Format() where {0},{1},… will be replaced with args[i] in order you pass params.

    in reply to: Ted2Go IDE #11053

    nerobot
    Participant

    I’ve been using Ted2Go for a few weeks now and enjoying it. Thank you for the work nerobot!

    Glad to hear! 🙂

Viewing 15 posts - 256 through 270 (of 805 total)